Skip to content

Differentiating commits in history between local-only and remote #5873

Closed

Description

@dsanders11

Please describe the problem you think should be solved
Currently the history view displays local commits the same as synced commits, minus 'View on Github' being greyed out. This isn't ideal as you can't tell at a glance what is local and needs to be pushed, and the 'undo' feature isn't accessible in the history view.

Do you have any potential solutions in mind?
I'd suggest a few changes to improve how local commits are shown in the history tab:

  1. Add a 'This commit has not been pushed' indicator somewhere, visually similar to the uncommitted changes indicator on the repository list. Possible implementations could be before the commit change message, at the end of it, or fixed in the upper right corner.

  2. If the commit is local, and at the top of the commits list, swap 'Revert This Commit' with 'Undo This Commit' so that the undo feature is available on the history view. This is nicer than undoing commits from the changes tab where you don't know how many are available to undo. I can't think of a reason you'd want to revert the top-level local commit rather than just undoing it.

  3. [Optional] This one is more work, but being able to edit the commit message of a local commit would be nice (I imagine under the covers that would be a git rebase which uses the reword option). I've definitely had cases where I have several local commits and I spot a typo in a commit message for one further back in the list. Using git rebase with the reword option is a simple solution, but it seems like GitHub Desktop could provide this functionality natively.

Activity

  1. billygriffin commented on Oct 11, 2018

    @billygriffin
    Contributor

    Hi @dsanders11, thanks for the idea! I also agree that the distinction between local and remote can be confusing as a general problem with Git and that we might be able to do some subtle things to improve that differentiation for people. Reading through the proposed solutions, it feels like only the first one is tied to the problem laid out above. Would you mind also including what problems 2 and 3 are solving to help align on further discussion?

  2. added
    user-research
    on Oct 11, 2018
  3. dsanders11 commented on Oct 11, 2018

    @dsanders11
    ContributorAuthor

    Reading through the proposed solutions, it feels like only the first one is tied to the problem laid out above.

    The title might be better served replacing the word view with functionality. As I started to lay this out I had other thoughts on the functionality of local commits, beyond the initial visual difference.

    Would you mind also including what problems 2 and 3 are solving to help align on further discussion?

    Well, 2 is making 'Undo' for local commits into more of a nicely supported feature. It's currently a bit strange how it is shoehorned in to the bottom of the Changes tab, since it's the only thing on that tab which shows commits, everything else commit related is under the History tab. As such I was on the History tab looking at those commits, and wanted to undo the last one. The only option there currently is for revert, which isn't what I want since that actually creates a new commit. So it seems logical that the 'Undo' for local commits would be accessible from the History tab as well.

    As I mentioned on 3, the problem it is solving is wanting to change the commit message after making a local commit that hasn't been pushed to the remote yet. One of the benefits of having local commits is that you can still change them (with git rebase) before you push them to the remote.

    There's other possible functionality that I was musing with in my head but didn't put in the original description, mostly around bringing more git rebase functionality in for local commits. Again, the benefit of having unpushed local commits is you can tweak them before pushing. Committing often is useful during development, but you often want to squash multiple commits down to a single commit before pushing. If the History tab let you select multiple commits, you could accomplish this by selecting those local commits and right-click 'Combine commits' or something similar. It gets trickier to handle some of the more advanced git rebase functionality (such as dropping commits, changing commit order, etc) in the History tab, but some limited functionality could be added without too much strain.

  4. billygriffin commented on Oct 11, 2018

    @billygriffin
    Contributor

    Thanks for the explanation @dsanders11. I'm going to update this issue title to focus on the initial problem described. Except for larger initiatives, we try to keep issues constrained to one problem at a time so it's clear how the problem relates to the potential solutions discussed. We're discussing 2 and 3 internally, but if you'd like to open separate issues for those, you're welcome to do so.

    From the beginning, the problem as I understand it is:

    It's difficult to visually determine which commits are only local and need to be pushed vs. which commits are also already on the remote.

  5. changed the title [-]Improve View of Local Commits in History[/-] [+]Differentiating commits in history between local-only and remote[/+] on Oct 11, 2018
  6. billygriffin commented on Oct 11, 2018

    @billygriffin
    Contributor

    I also think this is related to #5330 in that it relates to differentiating between things that you have locally that are not yet on remote.

    Curious if @desktop/design has any thoughts about this.

  7. ampinsk commented on Oct 11, 2018

    @ampinsk
    Contributor

    I agree it would be really valuable to have a visual indication what commits have been pushed or not! I'm not sure off the top of my head what indicator we would use exactly, since we use the blue dot for "uncommitted." Maybe a ⬆️? Or something other than an icon?

  8. j-f1 commented on Oct 12, 2018

    @j-f1
    Contributor

    Perhaps a small ☁️ icon with a ✓ overlayed on it like the cloud-{up,down}load Octicons?

  9. shiftkey commented on Oct 18, 2018

    @shiftkey
    Member

    We had an earlier issue about this behaviour #4645 which I'll add the screenshot from @r-pascal about the classic behaviour:

  10. j-f1 commented on Oct 19, 2018

    @j-f1
    Contributor

    Looking at that, how about a ☁️ icon with a slash through it indicating unpushed status?

  11. donokuda commented on Oct 19, 2018

    @donokuda
    Contributor

    I agree it would be really valuable to have a visual indication what commits have been pushed or not! I'm not sure off the top of my head what indicator we would use exactly, since we use the blue dot for "uncommitted." Maybe a ⬆️? Or something other than an icon?

    I think @ampinsk's suggestion of using an ⬆️is more successful because it's aligned with what we show in the "Push/Pull/Fetch" button:

  12. ampinsk commented on Nov 28, 2018

    @ampinsk
    Contributor

    screen shot 2018-11-28 at 10 48 32 am

    I'm a fan of going with this ⬆️ icon on local commits, borrowing from the visual language in the Push button and the repo indicators. Does this make sense to folks?

  13. billygriffin commented on Nov 28, 2018

    @billygriffin
    Contributor

    @ampinsk That seems reasonable to me. My only concern is potential conflation of informational vs. actionable in the icon. In the push button, the up arrow indicates that it's an action you can take to push your commits up to the remote. But it seems to be working fine in the repo indicators, and those are informational, so that helps to mitigate my concern.

    I'm just a bit worried that people might see those commits and think you can click on that button to push them up. Could be as simple as including a tooltip that says something like "This commit has not yet been pushed to your remote branch" or something along those lines. Or it's possible I'm overthinking it.

  14. j-f1 commented on Nov 28, 2018

    @j-f1
    Contributor

    Plus the icon could be turned into a button to support pushing individual commits in the future, which I think has been requested before.

  15. binaryfunt commented on Feb 10, 2019

    @binaryfunt

    Could have an indicator on the last pushed commit saying origin/master like git log --decorate does

  16. self-assigned this
    on Mar 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

user-research

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions