git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: ryenus <ryenus@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git mailing list <git@vger.kernel.org>
Subject: Re: support comma-separated fetch specs list?
Date: Sat, 7 Nov 2020 18:11:02 +0800	[thread overview]
Message-ID: <CAKkAvawVbyTPxDFQMEJMh+dzgQ_C0PXtbQKMo8xMNjgL_buGng@mail.gmail.com> (raw)
In-Reply-To: <xmqq1rh9ptka.fsf@gitster.c.googlers.com>

On Wed, 4 Nov 2020 at 13:41, Junio C Hamano <gitster@pobox.com> wrote:
>
> ryenus <ryenus@gmail.com> writes:
>
> > It's nice to have negative ref spec support with 2.29 release, so now
> > we can have
> >
> > ```
> > [remote "origin"]
> >   fetch = +refs/heads/*:refs/remotes/origin/*
> >   fetch = ^refs/heads/gh-pages
> > ```
> >
> > What about having all the fetch specs put together in one comma-separated list?
> > Like this:
> >
> > ```
> > [remote "origin"]
> >   fetch = +refs/heads/*:refs/remotes/origin/*,^refs/heads/gh-pages
> > ```
>
> I thought comma was a valid character that you can have in refnames,
> so no, I do not think it would fly without breaking existing users.
>
> What problem are you trying to solve?

I guess the problem is mainly about intuition? Since comma-separated
lists are everywhere.

Personally I never thought about using comma in refnames, or even knew
it's allowed.

Well, now I know because, after skimming through the 2.29 release notes,
I tried out the negative refspec feature in a repo where I'd like to
exclude the gh-pages branch. But somehow I appended a comma and the
negative refspec to the existing fetch line, and expected it to work,
then, oops, I got dozens of those refnames with commas, and had to go
inside the .git dir and managed the clean up all the mess. And that's
for sure and nice and hard lesson :-)

Maybe the cause is also my ignorance or lack of carefulness to read the
docs, but searching for "comma separated list" in Git manual would
return hundreds of results:
https://www.google.com/search?q=%22comma+separated%22+list+site%3Agit-scm.com

So I guess it's fair to expect it to work in the fetch spec as well?

  reply	other threads:[~2020-11-07 10:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-04  3:11 support comma-separated fetch specs list? ryenus
2020-11-04  5:41 ` Junio C Hamano
2020-11-07 10:11   ` ryenus [this message]
2020-11-09 22:45     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKkAvawVbyTPxDFQMEJMh+dzgQ_C0PXtbQKMo8xMNjgL_buGng@mail.gmail.com \
    --to=ryenus@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).