Re: [PATCH] Add new @ shortcut for HEAD

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

 



Felipe Contreras <felipe.contreras@xxxxxxxxx> writes:

> On Tue, Apr 30, 2013 at 6:00 PM, Felipe Contreras
> <felipe.contreras@xxxxxxxxx> wrote:
>
>> +static int interpret_empty_at(const char *name, int namelen, int len,
>> struct strbuf *buf)
>> +{
>> +       if (namelen - len < 1 || name[len + 1] == '{')
>> +               return -1;
>> +
>> +       strbuf_reset(buf);
>> +       if (len == 0) {
>> +               strbuf_add(buf, "HEAD", 4);
>> +               return 1;
>> +       } else {
>> +               strbuf_add(buf, name, len);
>> +               return len + 1;
>> +       }
>> +}
>
> Hmm, it's not correct, and besides, if we don't parse 'master@', it's
> much simpler:
>
> /* parse @something syntax, when 'something' is not {.*} */
> static int interpret_empty_at(const char *name, int namelen, int len,
> struct strbuf *buf)
> {
> 	if (len || (namelen > 1 && name[1] == '{'))
> 		return -1;
>
> 	strbuf_reset(buf);
> 	strbuf_add(buf, "HEAD", 4);
> 	return 1;
> }

I'm done with today's integration cycle and pushed the series
without these updates out on 'pu'.  Hopefully you will have a "drop
the last N and replace them with this" update after finishing these
experiments by tomorrow? ;-)

Thanks.

People who wanted to see some form of typesaver for HEAD, please
poke at the implementation and see if there are cases where @ should
be interpreted as HEAD replacement but isn't (or vice-versa).
--
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]