git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC PATCH] Make the rebase edit mode really end up in an edit state

From
SZEDER Gábor <szeder@ira.uka.de>
Date
Jan 15, 2009, 15:35 UTC
Message-ID
<20090115153529.GA13961@neumann>
In-Reply-To
<7vfxjlxuu5.fsf@gitster.siamese.dyndns.org>
On Wed, Jan 14, 2009 at 04:43:14PM -0800, Junio C Hamano wrote:
Show 5 quoted lines
> I've always had trouble with the instruction we give for splitting one
> commit into two using the interactive rebase in the documentation, as it
> always had a strong "Huh?" effect on me when it suddenly starts talking
> about doing a "git reset HEAD^"; I suspect your change may improve this
> situation quite a bit.

I think we might want do differentiate editing a commit (modifying either the commit message or the patch or both) or splitting a commit.

The first is served well with the current 'edit' rebase command IMHO. I don't really see the point of the additional 'git reset --soft HEAD^'.

 * If you want to edit the commit message only, then you are
   better off with 'git commit --amend', because it preserves the
   previous commit message.  But with 'git reset --soft HEAD^' and
   'git commit' the commit message is "lost"; you have to use 'git
   commit -c ORIG_HEAD' instead, which is not that straightforward
   (and we don't have completion support for it).
 * If you want to modify the patch, too, then you would have to use
   'git add' anyway, regardless of whether there was a 'git reset
   --soft HEAD^', or not.  The only benefit of that 'reset' I'm seeing
   is that in that case 'git diff --cached' would show all the changes
   that would be committed; without the 'reset' 'git diff --cached
   HEAD^' is needed.
   But I'm not sure whether that benefit would offset the confusion of
   one more rebase command with just slightly different meaning.

For the second we could introduce a new rebase command like 'split', which would do the same as 'edit' but would also perform that 'git reset HEAD^' mentioned in the documentation automatically. Or perhaps it could be called 'divide', since the 's' abbreviation for 'split' is already taken by 'squash'. (Or maybe use capital 'S' for 'split'? might be confusing...)

Regards, Gábor

Previous: Johannes SchindelinNext: Junio C Hamano
Message 8 of 55 in “Make the rebase edit mode really end up in an edit state”
  1. Make the rebase edit mode really end up in an edit stateAnders Melchiorsen, Jan 15, 2009
  2. Junio C HamanoJan 15, 2009
  3. Boyd Stephen Smith Jr.Jan 15, 2009
  4. Miles BaderJan 15, 2009
  5. Boyd Stephen Smith Jr.Jan 15, 2009
  6. Junio C HamanoJan 15, 2009
  7. Johannes SchindelinJan 15, 2009
  8. SZEDER GáborJan 15, 2009
  9. Junio C HamanoJan 15, 2009
  10. Sverre RabbelierJan 15, 2009
  11. SZEDER GáborJan 15, 2009
  12. Björn SteinbrinkJan 16, 2009
  13. Johannes SchindelinJan 16, 2009
  14. Anders MelchiorsenJan 18, 2009
  15. Junio C HamanoJan 16, 2009
  16. Johannes SchindelinJan 16, 2009
  17. Stephan BeyerJan 15, 2009
  18. Johannes SchindelinJan 15, 2009
  19. Johannes SixtJan 15, 2009
  20. Johan HerlandJan 15, 2009
  21. Sverre RabbelierJan 15, 2009
  22. Johannes SchindelinJan 15, 2009
  23. Adeodato SimóJan 15, 2009
  24. Johannes SchindelinJan 15, 2009
  25. Sverre RabbelierJan 15, 2009
  26. Stephan BeyerJan 15, 2009
  27. Johannes SchindelinJan 15, 2009
  28. Adeodato SimóJan 15, 2009
  29. Sverre RabbelierJan 15, 2009
  30. Johannes SchindelinJan 15, 2009
  31. Sverre RabbelierJan 15, 2009
  32. Junio C HamanoJan 15, 2009
  33. Sverre RabbelierJan 15, 2009
  34. Johannes SchindelinJan 15, 2009
  35. Johan HerlandJan 15, 2009
  36. Anders MelchiorsenJan 15, 2009
  37. Johannes SchindelinJan 15, 2009
  38. Wincent ColaiutaJan 15, 2009
  39. Jay SoffianJan 15, 2009
  40. Wincent ColaiutaJan 15, 2009
  41. Johan HerlandJan 16, 2009
  42. Anders MelchiorsenJan 16, 2009
  43. Johan HerlandJan 16, 2009
  44. SZEDER GáborJan 16, 2009
  45. Johannes SchindelinJan 16, 2009
  46. SZEDER GáborJan 16, 2009
  47. Wincent ColaiutaJan 16, 2009
  48. Sverre RabbelierJan 16, 2009
  49. Stephan BeyerJan 16, 2009
  50. Johannes SchindelinJan 16, 2009
  51. Pieter de BieJan 15, 2009
  52. Sverre RabbelierJan 15, 2009
  53. Pieter de BieJan 15, 2009
  54. Björn SteinbrinkJan 15, 2009
  55. Johan HerlandJan 15, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.