Repository navigation
Show diff with HEAD~ in Staged Changes list when amending - #259
Conversation
This method does no caching for now.
|
The lag after unchecking the box is me confirming the EDIT - I've now tweaked the dialog so that we only use it when there's actually a chance of losing information. |
88e8505 to
59d6c95
Compare
59d6c95 to
ff21ed8
Compare
Signed-off-by: Nathan Sobo <nathan@github.com>
|
I tried a couple other clients: Tower, GitKraken, SourceTree, Fork, GitUp. And they all behave like current That said, I'm not totally against merging because it adds some extra flexibility that is not possible to do in another way. Once/if we add a commit history tough, I think it's more clear to separate tl;dr: Merge now, revert later (once a reset option is available) |
|
Basically I won't be able to stop using GitX if we don't support this, which would be pretty sad. I don't see what we lose by enabling this use case. |
1960675 to
87c472f
Compare
|
I really think this UX is much better, not just because Gitx does it. Suppose you want to remove some changes from a commit that you just created, but you still want those changes in your working copy. Before, you'd have to manually undo those changes, save the file, stage the undone changes, and then redo the changes manually. Now you can simply edit the commit and remove the changes, without ever changing your working copy: |
|
I also just think it makes more sense on a conceptual level. When a UI lets you edit some object, you should have a full view of the object, the same view that you had when you were first creating the object. With this behavior, when you amend a commit you have a full view of its contents just like you did when creating it. If for whatever reason you want to see your staged changes since the last commit, you still can: simply uncheck the |
|
@simurai Regarding |
|
@maxbrunsfeld Just hit that green button already and stop suffering! 😄 Unless @kuychaco is really against it. #259 (comment) are really good arguments for it.
Ya, if commit squashing allows to rename the commit, it's almost the same. Well, with reset, you could "squash" a couple of your last commits and then split them up differently into multiple commits again. I think as long as it's just behind a context menu, it wouldn't hurt having the option. |
heh I'm actually totally in favor of this feature, but just a slightly tweaked version of it =P @maxbrunsfeld makes very good points and I'm totally sold on the idea behind this workflow. In fact, I do this sort of thing all the time, but my version consists of using The thing that I find a bit off about the current implementation is the fact that the Staged Changes list does not show files that have changed relative to I'll make a recommendation for tweaking this particular PR for now, and then discuss why I think we should eventually just do away with this whole "amend" checkbox entirely once we've built out a more comprehensive UI. Let's take a step back and think about what we're actually trying to do here. The user has made a commit and then realized that they want to make a change to that commit's content. So basically they want to go back in time to right before they hit the commit button. Well, the way to get back to this state on the command line is to type For nowTo achieve the workflow desired with this PR, I suggest we make it such that checking the amend box does a The futureOriginally, the amend checkbox was created to mirror the Here is where we can do better than Git's command line porcelain and create our own intuitive graphical equivalent. The user will be able to easily interact with their commit graph to edit, squash, delete, and re-arrange commits. The vision@nathansobo said it best in his Graphical Porcelain narrative:
And when this ✨ dream ✨ becomes the reality for Atom, I say we 🔥 that ✅. /cc @iolsen for thoughts on timing and milestone placement |


Closes #256
I put this together so we could discuss the merits of this UX. Personally, I think it's a lot more intuitive to show the commit that you're editing, but maybe that's because I used Gitx for a while.
GIF showing the new interaction below
/cc @kuychaco @BinaryMuse @simurai @nathansobo