Gitup: When amending, include changes from previous commit in index

Created on 2 Mar 2016  路  7Comments  路  Source: git-up/GitUp

enhancement

Most helpful comment

@swisspol I'm taking the latter approach. Basically I'm working to change which diffs are presented visually (the visual state of the commit view is based off of the state of HEAD^ when 'amend' is checked), but maintaining the rest of the commit controller to work with diffs based on HEAD. If I'm reasoning about this correctly, the existing behaviour should sort that diff out to do the right thing at commit time.

Working so far:

  • Updating GCLiveRepository to have a lazily evaluated set of working set / index diffs based on HEAD^. (tests on this will be added as well).
  • Updating GIAdvancedCommitViewController so that it (optionally) updates its contained view controllers with those diffs when 'amend' is checked.

This is mostly working, though not ready for a PR yet. If you can see any non-obvious problems with this approach, I'd be happy to take this in a direction you think better.

All 7 comments

Also, what about populating the previous message too? This is one of my heavily used features in GitX.

Edit: Ignore me, appears it does just that. I can't recall why I thought it wasn't now.

@swisspol note that you took off the 'easy' tag. I was thinking about building out a PR for this, assuming it would in fact be 'easy'. Thar-be-dragons here?

'easy' was temporarily added by mistake, it's not a trivial feature indeed: this requires either moving the HEAD which is not a very good idea or changing the way the diff view works so it can "emulate" the equivalent behavior.

@swisspol I'm taking the latter approach. Basically I'm working to change which diffs are presented visually (the visual state of the commit view is based off of the state of HEAD^ when 'amend' is checked), but maintaining the rest of the commit controller to work with diffs based on HEAD. If I'm reasoning about this correctly, the existing behaviour should sort that diff out to do the right thing at commit time.

Working so far:

  • Updating GCLiveRepository to have a lazily evaluated set of working set / index diffs based on HEAD^. (tests on this will be added as well).
  • Updating GIAdvancedCommitViewController so that it (optionally) updates its contained view controllers with those diffs when 'amend' is checked.

This is mostly working, though not ready for a PR yet. If you can see any non-obvious problems with this approach, I'd be happy to take this in a direction you think better.

Is this still not implemented? I have to switch back to GitX just to do this!

@chnrxn Always accepting pull requests 馃槉

I never ended up getting my PR over the line, but instead ended up using a combo of ^T, U, D, F and the odd stash to get similar things done in the tree view. Turns out to be a much more general set of tools that solves a bunch of other problems in addition to explicit amends.

I also still use the amend option as is quite often, FWIW.

Was this page helpful?
0 / 5 - 0 ratings