Re: [PATCH RFC v2 08/19] rebase -i: Root commits are replayed with an unnecessary option
- From
Fabian Ruch <bafain@gmail.com>
- Date
- Jul 19, 2014, 18:14 UTC
- Message-ID
- <53CAB593.5040306@gmail.com>
- In-Reply-To
- <xmqq7g3aobib.fsf@gitster.dls.corp.google.com>
Hi Junio,
Junio C Hamano writes:
Show 8 quoted lines
> Fabian Ruch <bafain@gmail.com> writes: >> It makes the next patch easier to understand because the finalising >> command line "git commit --allow-empty --amend --no-post-rewrite -n >> --no-edit" seems to be simply moved to the end of do_pick. Substituting >> --no-edit for -C there would make that log message overly long ... > > And the reason why the same "-C $1" is not used and "--no-edit" is used > in the final version that is moved to the end of do_pick is...?
The finalising command line is executed by do_pick to rewrite $1 when it is being replayed.
For instance, one purpose of rewriting is amending the current head with the changes introduced by $1. In this case, we don't want the log message of $1 to be the final log message. Another purpose of rewriting is using a text file or a string as log message, which would be defeated by "-C $1" as well.
It's true that, by the time the next patch is introduced, do_pick doesn't yet implement either rewriting mechanism (they are both used to thread "squash" through do_pick later on) but these considerations suggest that "-C $1" might not be what we want to use to disable the log message editor.
Fabian