git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* support comma-separated fetch specs list?
@ 2020-11-04  3:11 ryenus
  2020-11-04  5:41 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: ryenus @ 2020-11-04  3:11 UTC (permalink / raw)
  To: Git mailing list

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

Thanks

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: support comma-separated fetch specs list?
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2020-11-04  5:41 UTC (permalink / raw)
  To: ryenus; +Cc: Git mailing list

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?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: support comma-separated fetch specs list?
  2020-11-04  5:41 ` Junio C Hamano
@ 2020-11-07 10:11   ` ryenus
  2020-11-09 22:45     ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: ryenus @ 2020-11-07 10:11 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git mailing list

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?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: support comma-separated fetch specs list?
  2020-11-07 10:11   ` ryenus
@ 2020-11-09 22:45     ` Junio C Hamano
  0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2020-11-09 22:45 UTC (permalink / raw)
  To: ryenus; +Cc: Git mailing list

ryenus <ryenus@gmail.com> writes:

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

I doubt it.

The contents of these "comma separated list" are taken from a fixed
vocabulary and not from unbounded set of things the end-user can
freely come up with that allows a comma as part of values.

In other words, "--option=ours,theirs" may make sense only because
we control the vocabulary 'common', 'ours', and 'theirs', and we
make sure the vocabulary does not contain any word with comma in it.

When somebody adds a new option, we try hard during the review not
to allow "--option=thing1,thing2,thing3" as the syntax we give at
the UI level where thing$n are end-user controlled values, because
that would rob end-users from the option of having a comma in their
thing$n (for whatever reason).  Certain kind of things naturally do
not make sense to contain comma in them (e.g. list of numbers, for
example) and we may allow end-user controlled input as part of a
comma separated tuple, and when the tuple has a fixed length whose
size will never change, we may allow end-user controlled thing as
the last element of such a comma-separated tuple, but extending that
to refspec, pathspec, etc. is a bit of stretch, I would have to say.




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-11-09 22:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2020-11-09 22:45     ` Junio C Hamano

Code repositories for project(s) associated with this 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).