Re: [PATCH 1/3] git-branch: add --track and --no-track options

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

 



>> There is.  The man page says "Scanning stops when an input character 
>> does not match such a format character."  Scanning includes not 
>> processing %n elements, either.
> 
> So, if you want to be that precise, it never says that it does not touch 
> the pointers passed to it.

It cannot know that there *are* any pointers unless it goes on scanning the format string.  Since the function it varargs, it cannot *guess* that there are any without scanning that the documentation says does not happen.  Anyway...

> But it states very clearly what the return 
> value is in case of a failure.

Actually ISTR that %n is not counted in the return value and that's why I wrote the code this way.

> Yes, this is what the source does. But again, the return value is what you 
> should -- and indeed forever can -- rely on. I am not really happy that 
> dwim_ref() touches ref, even if nothing was found, but it is an 
> _implementation detail_.

It's not fair to not have any documentation in the code, force the contributor to reverse engineer the documentation, and say it is relying on an implementation detail.  In otherwise undocumented code, implementation == interface.

Paolo
-
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]