Re: [PATCH 3/3] checkout: allow -b/-B to work on a merge base
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 26, 2019, 03:02 UTC
- Message-ID
- <xmqqmukdv57q.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <031780431d790c16b3862d6f155693e197bb74ed.1556226502.git.liu.denton@gmail.com>
Denton Liu <liu.denton@gmail.com> writes:
> - new_branch_info->name = arg; > + new_branch_info->name = strstr(arg, "...") ? > + xstrdup(oid_to_hex(rev)) : > + arg;
Can we do better?
I am not sure why we want to hardcode the knowledge of "..." syntax like this here. "git checkout A...B" introduced in 2009 needed only a single-liner change from get_sha1() to get_sha1_mb() without making the ugly implementation detail seep into this layer.