Re: [PATCH v2 03/14] sequencer: lib'ify write_message()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 29, 2016, 20:27 UTC
- Message-ID
- <xmqqfupn9v76.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <6cc2e834ae9e595625fbbc6922613994098fd7dc.1472219214.git.johannes.schindelin@gmx.de>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
Show 14 quoted lines
> Instead of dying there, let the caller high up in the callchain > notice the error and handle it (by dying, still). > > The only caller of write_message(), do_pick_commit() already checks > the return value and passes it on to its callers, so its caller must > be already prepared to handle error returns, and with this step, we > make it notice an error return from this function. > ... > @@ -223,7 +226,7 @@ static int fast_forward_to(const unsigned char *to, const unsigned char *from, > > read_cache(); > if (checkout_fast_forward(from, to, 1)) > - exit(128); /* the callee should have complained already */ > + return -1; /* the callee should have complained already */
This hunk does not seem to have anything to do with write_message() conversion, other than that its only caller, do_pick_commit(), also calls write_message(). checkout_fast_forward() itself can die when it cannot write the index, though, so this hunk may deserve to be in its own patch that teaches checkout_fast_forward() to instead return an error if/when its caller desires.
With the updated message, the series has become far easier to review, and the reordering them to sequencer-pick-revisions at the beginning makes quite a lot of sense.