Re: mark parsing in fast-import
- From
- Jörg Sommer <joerg@alea.gnuu.de>
- Date
- Apr 22, 2008, 09:39 UTC
- Message-ID
- <20080422093942.GA3752@alea.gnuu.de>
- In-Reply-To
- <20080421235940.GQ29771@spearce.org>
Hallo Shawn,
Shawn O. Pearce schrieb am Mon 21. Apr, 19:59 (-0400):
Show 11 quoted lines
> Jrg Sommer <joerg@alea.gnuu.de> wrote: > > Yes, you're right. I've checked some other functions and found this > > behaviour. Can I use a different behabiour, i.e. return 0 on failure and > > !0 on success? > > I wasn't objected to the return values as written, but more to the > fact that it seemed like a logic error to me. We use both patterns > in Git. Perhaps the best example to follow is get_sha1_hex(); > it returns -1 on error and 0 on success. So a common pattern is > "!get_sha1_hex()" to ensure a successful conversion of a hex string > to an unsigned char array.
Thanks for this explanation. This was what I was looking for.
Another question: Is :0 a valid mark? In import_marks() is a check for !mark, but I haven't seen it anywhere else.
Bye, Jörg.
-- Du hast keine Chance – also nutze sie.