4

When staging files with git add in patch mode (-p) I sometimes find a mistake that I would like to correct, before keeping on with adding further changes.

Many possible options are prompted: confyrm, plunk, split, edit, etc..

But I don't see any way to re-read the file and refresh the diff so I can see new updated changes, that I might have carried on in the meanwhile.

Usually I need to quit git-add, and re-run it (eventually having to re-skip all eventual chunks, in order to finally get again to the chunk I edited during the previous git add -p).

Is there any (native, or artificial) way for making the process more convenient and just refresh the diff?

Kamafeather
  • 8,663
  • 14
  • 69
  • 99
  • 1
    No, there is no way to make it more convenient. Well, you can get the source code and change it and build a new version of Git. So, yes: change Git. :-) – torek Nov 10 '20 at 00:52
  • Mmmh, then writing a hacky shell script, able to track choices over the chunks via */dev/stdin* and replay them on `[CTRL] + R`, might possibly require less work ;) – Kamafeather Nov 10 '20 at 02:02
  • Well, yes, anything that plays with the inputs like that... :-) – torek Nov 10 '20 at 05:00

0 Answers0