Re: [PATCH v1 5/8] sequencer: don't die in print_commit_summary()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 10, 2017, 18:05 UTC
- Message-ID
- <xmqqk1yyf1q0.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <072b0edb-7a30-77f3-2ac5-893c28c0a695@talktalk.net>
Phillip Wood <phillip.wood@talktalk.net> writes:
Show 21 quoted lines
> On 07/11/17 15:13, Junio C Hamano wrote: > ... >> Another possibility perhaps is that the function is safe to reuse >> already even without this patch, of course ;-). >> > Hmm, maybe it is. Looking at pick_commits() and do_pick_commit() if the > sequencer dies in print_commit_summary() (which can only happen when > cherry-picking or reverting) then neither the todo list or the abort > safety file are updated to reflect the commit that was just made. > > As I understand it print_commit_summary() dies because: (i) it cannot > resolve HEAD either because some other process is updating it (which is > bad news in the middle of a cherry-pick); (ii) because something went > wrong HEAD is corrupt; or (iii) log_tree_commit() cannot read some > objects. In all those cases dying will leave the sequencer in a sane > state for aborting - 'git cherry-pick --abort' will rewind HEAD to the > last successful commit before there was a problem with HEAD or the > object database. If the user somehow fixes the problem and runs 'git > cherry-pick --continue' then the sequencer will try and pick the same > commit again which may or may not be what the user wants depending on > what caused print_commit_summary() to die.
The above is all good analysis---thanks for your diligence. Perhaps some if not all of it can go to the log message?