Re: [PATCH 08/14] revert: Separate cmdline parsing from functional code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Jonathan Nieder writes:
> Ramkumar Ramachandra wrote:
>> --- a/builtin/revert.c
>> +++ b/builtin/revert.c
> [...]
>> @@ -612,7 +610,10 @@ int cmd_cherry_pick(int argc, const char **argv, const char *prefix)
>>
>>       memset(&opts, 0, sizeof(struct replay_opts));
>>       opts.action = CHERRY_PICK;
>> -     res = revert_or_cherry_pick(argc, argv, &opts);
>> +     git_config(git_default_config, NULL);
>> +     me = "cherry-pick";
>> +     parse_args(argc, argv, &opts);
>> +     res = pick_commits(&opts);
>>       if (res < 0)
>>               die(_("%s failed"), me);
>>       return res;
>
> I'd put the "me =" line right after "opts.action =" if doing it this
> way.  This means callers to pick_commits() are responsible for setting
> the "me" variable and in particular it will not make sense to export
> that function to callers outside of this file any more, right?

Exactly.  Good point.

-- Ram
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]