Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fea70d2

Browse files
authored
Merge pull request atom#1318 from atom/rfc-recent-commits
Recent commit changes RFC
2 parents f87a102 + 8f83aa4 commit fea70d2

File tree

2 files changed

+157
-0
lines changed

2 files changed

+157
-0
lines changed

docs/rfcs/000-template.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Feature title
2+
3+
## Status
4+
5+
Proposed
6+
7+
## Summary
8+
9+
One paragraph explanation of the feature.
10+
11+
## Motivation
12+
13+
Why are we doing this? What use cases does it support? What is the expected outcome?
14+
15+
## Explanation
16+
17+
Explain the proposal as if it was already implemented in the GitHub package and you were describing it to an Atom user. That generally means:
18+
19+
- Introducing new named concepts.
20+
- Explaining the feature largely in terms of examples.
21+
- Explaining any changes to existing workflows.
22+
- Design mock-ups or diagrams depicting any new UI that will be introduced.
23+
24+
## Drawbacks
25+
26+
Why should we *not* do this?
27+
28+
## Rationale and alternatives
29+
30+
- Why is this approach the best in the space of possible approaches?
31+
- What other approaches have been considered and what is the rationale for not choosing them?
32+
- What is the impact of not doing this?
33+
34+
## Unresolved questions
35+
36+
- What unresolved questions do you expect to resolve through the RFC process before this gets merged?
37+
- What unresolved questions do you expect to resolve through the implementation of this feature before it is released in a new version of the package?
38+
- What related issues do you consider out of scope for this RFC that could be addressed in the future independently of the solution that comes out of this RFC?
39+
40+
## Implementation phases
41+
42+
- Can this functionality be introduced in multiple, distinct, self-contained pull requests?
43+
- A specification for when the feature is considered "done."

docs/rfcs/001-recent-commits.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Recent commit view
2+
3+
## Status
4+
5+
Proposed
6+
7+
## Summary
8+
9+
Display the most recent few commits in a chronologically-ordered list beneath the mini commit editor. Show commit author and committer usernames and avatars, the commit message, and relative timestamp of each.
10+
11+
## Motivation
12+
13+
* Provide useful context about recent work and where you left off.
14+
* Allow user to easily revert and reset to recent commits.
15+
* Make it easy to undo most recent commit action, supersede amend check box.
16+
* Reinforce the visual "flow" of changes through being unstaged, staged, and now committed.
17+
* Provide a discoverable launch point for an eventual log feature to explore the full history.
18+
* Achieve greater consistency with GitHub desktop:
19+
20+
![desktop](https://user-images.githubusercontent.com/7910250/36570484-1754fb3c-17e7-11e8-8da3-b658d404fd2c.png)
21+
22+
## Explanation
23+
24+
### Blank slate
25+
26+
If the active repository has no commits yet, display a short panel with a background message: "Make your first commit".
27+
28+
### Recent commits
29+
30+
Otherwise, display a **recent commits** section containing a sequence of horizontal bars for ten **relevant** commits with the most recently created commit on top. The commits that are considered **relevant** include:
31+
32+
* Commits reachable by the remote tracking branch that is the current upstream of `HEAD`. If more than three of these commits are not reachable by `HEAD`, they will be hidden behind an expandable accordion divider.
33+
* Commits reachable by `HEAD` that are not reachable by any local ref in the git repository.
34+
* The single commit at the tip of the branch that was branched from.
35+
36+
The most recent three commits are visible by default and the user can scroll to see up to the most recent ten commits. The user can also drag a handle to resize the recent commits section and show more of the available ten.
37+
38+
### Commit metadata
39+
40+
Each **recent commit** within the recent commits section summarizes that commit's metadata, to include:
41+
42+
* GitHub avatar for both the committer and (if applicable) author. If either do not exist, show a placeholder.
43+
* The commit message (first line of the commit body) elided if it would be too wide.
44+
* A relative timestamp indicating how long ago the commit was created.
45+
* A greyed-out state if the commit is reachable from the remote tracking branch but _not_ from HEAD (meaning, if it has been fetched but not pulled).
46+
47+
### Undo
48+
49+
On the most recent commit, display an "undo" button. Clicking "undo" performs a `git reset` and re-populates the commit message editor with the existing message.
50+
51+
### Refs
52+
53+
Annotate visible commits that correspond to refs in the git repository (branches and tags). If the commit list has been truncated down to ten commits from the full set of relevant commits, display a message below the last commit indicating that additional commits are present but hidden.
54+
55+
### Context menu
56+
57+
Right-clicking a recent commit reveals a context menu offering interactions with the chosen commit. The context menu contains:
58+
59+
* For the most recent commit only, an "Amend" option. "Amend" is enabled if changes have been staged or the commit message mini-editor contains text. Choosing this applies the staged changes and modified commit message to the most recent commit, in a direct analogue to using `git commit --amend` from the command line.
60+
* A "Revert" option. Choosing this performs a `git revert` on the chosen commit.
61+
* A "Hard reset" option. Choosing this performs a `git reset --hard` which moves `HEAD` and the working copy to the chosen commit. When chosen, display a modal explaining that this action will discard commits and unstaged working directory context. Extra security: If there are unstaged working directory contents, artificially perform a dangling commit, disabling GPG if configured, before enacting the reset. This will record the dangling commit in the reflog for `HEAD` but not the branch itself.
62+
* A "Mixed reset" option. Choosing this performs a `git reset` on the chosen commit.
63+
* A "Soft reset" option. Choosing this performs a `git reset --soft` which moves `HEAD` to the chosen commit and populates the staged changes list with all of the cumulative changes from all commits between the chosen one and the previous `HEAD`.
64+
65+
### Balloon
66+
67+
On click, select the commit and reveal a balloon containing:
68+
69+
* Additional user information consistently with the GitHub integration's user mention item.
70+
* The full commit message and body.
71+
* The absolute timestamp of the commit.
72+
* Navigation button ("open" to a git show-ish pane item)
73+
* Action buttons ("amend" on the most recent commit, "revert", and "reset" with "hard", "mixed", and "soft" suboptions)
74+
75+
![commit-popout](https://user-images.githubusercontent.com/17565/36570682-11545cae-17e8-11e8-80a8-ffcf7328e214.JPG)
76+
77+
### Bottom Dock
78+
79+
If the Git dock item is dragged to the bottom dock, the recent commit section will remain a vertical list but appear just to the right of the mini commit editor.
80+
81+
![bottom-dock](https://user-images.githubusercontent.com/17565/36570687-14738ca2-17e8-11e8-91f7-5cf1472d871b.JPG)
82+
83+
## Drawbacks
84+
85+
Consumes vertical real estate in Git panel.
86+
87+
The "undo" button is not a native git concept. This can be mitigated by adding a tooltip to the "undo" button that defines its action: a `git reset` and commit message edit.
88+
89+
The "soft reset" and "hard reset" context menu options are useful for expert git users, but likely to be confusing. It would be beneficial to provide additional information about the actions that both will take.
90+
91+
The modal dialog on "hard reset" is disruptive considering that the lost changes are recoverable from `git reflog`. We may wish to remove it once we visit a reflog view within the package. Optionally add "Don't show" checkbox to disable modal.
92+
93+
## Rationale and alternatives
94+
95+
- Display tracking branch in separator that indicates which commits have been pushed. This could make the purpose of the divider more clear. Drawback is that this takes up space.
96+
97+
## Unresolved questions
98+
99+
- Allow users to view the changes introduced by recent commits. For example, interacting with one of the recent commits could launch a pane item that showed the full commit body and diff, with additional controls for reverting, discarding, and commit-anchored interactions.
100+
- Providing a bridge to navigate to an expanded log view that allows more flexible and powerful history exploration.
101+
- Show an info icon and provide introductory information when no commits exist yet.
102+
- Add a "view diff from this commit" option to the recent commit context menu.
103+
- Integration with and navigation to "git log" or "git show" pane items when they exist.
104+
- Can we surface the commit that we make on your behalf before performing a `git reset --hard` with unstaged changes? Add an "Undo reset" option to the context menu on the recent commit history until the next commit is made? Show a notification with the commit SHA after the reset is complete?
105+
106+
## Implementation phases
107+
108+
1. Convert `GitTabController` and `GitTabView` to React. [#1319](https://github.com/atom/github/pull/1319)
109+
2. List read-only commit information. [#1322](https://github.com/atom/github/pull/1322)
110+
3. Replace the amend checkbox with the "undo" control.
111+
4. Context menu with actions.
112+
5. Balloon with action buttons and additional information.
113+
6. Show which commits have been pushed.
114+
7. Show information about other refs.

0 commit comments

Comments
 (0)