Re: [PATCH 05/13] revert: Eliminate global "commit" variable
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 21, 2011, 19:23 UTC
- Message-ID
- <7vei2n7zuj.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1308661489-20080-6-git-send-email-artagnon@gmail.com>
Ramkumar Ramachandra <artagnon@gmail.com> writes:
> Since we want to develop the functionality to either pick or revert > individual commits atomically later in the series, make "commit" a > local variable. Doing this involves changing several functions to > take an additional argument, but no other functional changes.
Actually you didn't make it a local variable. You made it a parameter to be passed around, which is even better ;-).
> -static void write_cherry_pick_head(void) > +static void write_cherry_pick_head(const char *commit_sha1_hex)
Wouldn't we prefer to see this parameter also to be a commit objet, not a preformatted hex string? The only exception would be if you are going to introduce a future callsite that does not have a commit object but may know the commit object name, but if you are not going to do so, then...