Re: [PATCH 1/4] refspec: treat 'fetch' as a Boolean value

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

 



On Mon, Mar 17, 2025 at 06:24:24PM -0400, Taylor Blau wrote:

> Since 6d4c057859 (refspec: introduce struct refspec, 2018-05-16), we
> have constants called REFSPEC_FETCH and REFSPEC_PUSH. This misleadingly
> suggests that we might introduce other modes in the future.

I don't know that I'd call it misleading. We _could_ introduce new modes
if we had new operations. But I do agree it's unlikely (even if we had
other operations like git-archive, cat-file, etc, they would probably
not have refspecs).

So it seems like a reasonable direction to me.

The one thing I don't like is:

> diff --git a/builtin/pull.c b/builtin/pull.c
> index 9c4a00620a..8bbfcce729 100644
> --- a/builtin/pull.c
> +++ b/builtin/pull.c
> @@ -738,7 +738,7 @@ static const char *get_tracking_branch(const char *remote, const char *refspec)
>  	const char *spec_src;
>  	const char *merge_branch;
>  
> -	refspec_item_init_or_die(&spec, refspec, REFSPEC_FETCH);
> +	refspec_item_init_or_die(&spec, refspec, 1);

The third argument here (and elsewhere) becomes much more mysterious to
the reader.  Maybe not a big deal, though.

> diff --git a/git-diff-pairs b/git-diff-pairs

Hmm.... :)

-Peff




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

  Powered by Linux