Re: [PATCH 14/14] pull --rebase: error on no merge candidate cases

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

 



Hi,

On 2015-05-19 02:12, Stefan Beller wrote:
> On Mon, May 18, 2015 at 8:06 AM, Paul Tan <pyokagan@xxxxxxxxx> wrote:
>> Tweak the error messages printed by die_no_merge_candidates() to take
>> into account that we may be "rebasing against" rather than "merging
>> with".
>>
>> Signed-off-by: Paul Tan <pyokagan@xxxxxxxxx>
>> ---
>>  builtin/pull.c | 42 +++++++++++++++++++++++++-----------------
>>  1 file changed, 25 insertions(+), 17 deletions(-)
>>
>> diff --git a/builtin/pull.c b/builtin/pull.c
>> index c8d673d..15b65a0 100644
>> --- a/builtin/pull.c
>> +++ b/builtin/pull.c
>> @@ -474,10 +474,12 @@ static void NORETURN die_no_merge_candidates(const char *repo, const char **refs
>>         const char *remote = curr_branch ? curr_branch->remote_name : NULL;
>>
>>         if (*refspecs) {
>> -               fprintf(stderr,
>> -                       _("There are no candidates for merging among the refs that you just fetched.\n"
>> -                       "Generally this means that you provided a wildcard refspec which had no\n"
>> -                       "matches on the remote end.\n"));
>> +               if (opt_rebase)
>> +                       fputs(_("There is no candidate for rebasing against among the refs that you just fetched."), stderr);
> 
> Is there a reason you switch to fputs, instead of fprintf?
> $grep -I -r fputs|wc -l
> 123
> $ grep -I -r fprintf|wc -l
> 689
> 
> fputs seems to be used already, though I never came across these parts
> of the code
> myself, so I wondered if we had fputs in the code base already.

My guess was that the new-line I expected and did not see in the `fputs()` call was the reason. But according to http://pubs.opengroup.org/onlinepubs/009695399/functions/fputs.html:

    The puts() function appends a <newline> while fputs() does not.

This comment concludes my review on this round of this patch series. It required quite some time to review, so it must have taken quite a bit more to actually write it: impressive work!

Ciao,
Dscho
--
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]