Re: [PATCH] git-parse-remote.sh: Remove op_prep argument
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 4, 2017, 05:09 UTC
- Message-ID
- <xmqqd1ey8rul.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CAFZEwPMGTzVuLMSzm8wiNxvia4AV0T79C1ZTfcuO4=Bydz_zQA@mail.gmail.com>
Pranit Bauva <pranit.bauva@gmail.com> writes:
Show 8 quoted lines
> So if you want a better commit message then you could probably use this, > "parse-remote: remove reference to unused op_prep > > This argument was introduced in the commit 15a147e618 to help in > writing out the error message but then in commit 045fac5845, the > reference to op_prep got removed. Thus the argument is no longer > useful and is removed. > "
Expand the reference to commits like so:
15a147e618 ("rebase: use @{upstream} if no upstream specified",
2011-02-09)Also pay attention to the subject, in which it is unclear whose argument "op_prep" is. Other than that, your rewrite is more readable than the original.
The error_on_missing_default_upstream helper function learned to
take op_prep argument with 15a147e618 ("rebase: use @{upstream}
if no upstream specified", 2011-02-09), but as of 045fac5845
("i18n: git-parse-remote.sh: mark strings for translation",
2016-04-19), the argument no longer is used. Remove it.Show 8 quoted lines
>> The contrib/examples/git-pull.sh file also has a variable op_prep which is used >> in one of the messages shown the user. Should I remove this variable as well? > > Not really. We have kept the file git-pull.sh just as an example of > how git-pull was initially implemented. So previously git-pull was a > shell script which was then ported to C code. After that conversion, > the shell script was just put as it is in contrib/examples/ as a use > case of how git-pull should be implemented.
Yes, with s/should/could/. I agree with you that we should leave it as-is.