git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Robin H. Johnson" <robbat2@gentoo.org>
To: git@vger.kernel.org, robbat2@gentoo.org
Subject: [RFC] single-level refs vs push --all/--mirror
Date: Sat, 20 Nov 2021 00:03:36 +0000	[thread overview]
Message-ID: <robbat2-20211119T234158-903098822Z@orbis-terrarum.net> (raw)
In-Reply-To: <robbat2-20211116T061554-223495439Z@orbis-terrarum.net>

[-- Attachment #1: Type: text/plain, Size: 2650 bytes --]

On Tue, Nov 16, 2021 at 06:28:28AM +0000, Robin H. Johnson wrote:
> > Perhaps there's a bug, but it is meant to and does push all refs in a
> > simple case:
> ...
> > There I used an explicit refspec naming it. But if I used "refs/*"
> > (which is what --mirror is doing under the hood), then it doesn't even
> > try sending it, as the client filters it out from the wildcard
> > (otherwise, everyone would get server-side errors from refs/stash).
> > 
> > So you probably want to choose a different refname to store your data.
> > 
> > I do think the status of these single-level refs is not well documented.
> > The rules in git-check-ref-format(1) imply that they are not valid:
..
> >   They must contain at least one /. This enforces the presence of a
> >   category like heads/, tags/ etc. but the actual names are not
> >   restricted.
> > 
> > but that rule is not enforced internally, as "refs/" is sufficient for
> > the internal check_refname_format() to allow it. But receive-pack has,
> > since 1a7141ff28 (Ignore funny refname sent from remote, 2005-10-13),
> > implemented the format check after stripping refs/. And then the client
> > side followed that lead in 30affa1e9a (send-pack: do not send out
> > single-level refs such as refs/stash, 2008-10-29).
> 
> And the format of the ref wasn't noticed in the hook was previously
> posted back in 2014 :-(.
> https://www.spinics.net/lists/git/msg244053.html
> https://groups.google.com/forum/#!topic/gitolite/7cSrU6JorEY

Hi,

I didn't see response from Jeff King, so I'm wondering good next steps
here.

I'm esp. surprised that git-stash ends up using single-level refs when
git-check-ref-format(1) says they aren't valid.

I think Git should change git-stash and start issuing warnings to users
for single-level refs.

Therein leads a question:
What should be done with refs/stash?

Being able to work on stashes between multiple systems MIGHT be useful
to some users, so maybe they do want it pushed with --mirror/--all.

Choices (not mutually exclusive):
1. Push the refs anyway
2. Make a configurable way to exclude refs from being pushed w/ --mirror/--all
   e.g. move refs/stash to the exclude list, then push everything not
   that is not excluded.
3. Change the rules to accept single-level refs?
4. Cleanup phases of warnings before errors and good migration
   mechanisms?
5. Something else?

-- 
Robin Hugh Johnson
Gentoo Linux: Dev, Infra Lead, Foundation Treasurer
E-Mail   : robbat2@gentoo.org
GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85
GnuPG FP : 7D0B3CEB E9B85B1F 825BCECF EE05E6F6 A48F6136

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1113 bytes --]

  reply	other threads:[~2021-11-20  0:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15  6:53 [BUG] git push --mirror ignores refs outside head & tags Robin H. Johnson
2021-11-15 21:04 ` Jeff King
2021-11-16  6:28   ` Robin H. Johnson
2021-11-20  0:03     ` Robin H. Johnson [this message]
2021-11-20  6:05       ` [RFC] single-level refs vs push --all/--mirror 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=robbat2-20211119T234158-903098822Z@orbis-terrarum.net \
    --to=robbat2@gentoo.org \
    --cc=git@vger.kernel.org \
    /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).