Re: [PATCH v2] branch -D: allow - as abbreviation of '@{-1}'

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

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> I _think_ strbuf_branchname() leaves "@{-<N>}" when you do not have
> enough branch switches in the reflog, so perhaps ...

This is a tangent, but the value returned from strbuf_branchname()
is not well documented, and nobody looks at it.  It might not be a
bad idea to change the return value from the function in such a way
that it can signal "I saw @{-<N>} syntax but there weren't enough
branch switches" and also "I saw branch@{upstream} syntax but that
branch does not have an upstream configured for it" to its callers.

That way, the suggested "perhaps like this..." patch does not have
to do an ugly hack: if (starts_with(bname.buf, "@{-")).


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