git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git push tags

From
Kacper Kornet <draenog@pld-linux.org>
Date
Oct 26, 2012, 18:20 UTC
Message-ID
<20121026182020.GF10560@camk.edu.pl>
In-Reply-To
<CAM9Z-nkBO1dbF-sBFLuxM_S_MT79Cx=gLEL+83XKB7ys8VTqNQ@mail.gmail.com>
On Fri, Oct 26, 2012 at 02:07:09PM -0400, Drew Northup wrote:
Show 8 quoted lines
> On Fri, Oct 26, 2012 at 1:42 PM, Kacper Kornet <draenog@pld-linux.org> wrote:
> > On Thu, Oct 25, 2012 at 05:16:00PM -0400, Drew Northup wrote:
> >> On Thu, Oct 25, 2012 at 3:05 PM, Angelo Borsotti
> >> <angelo.borsotti@gmail.com> wrote:
> >> > Are remote repositories less protected than the local ones? I
> >> > think that to be consistent, the same strategy should be used on all
> >> > repositories, i.e. rejecting changes on tags by default, unless they
> >> > are forced.
Show 6 quoted lines
> >> So here we come to the core argument. Is sounds to me like you want
> >> changes to remote tags to work differently from push updates to ALL
> >> other references. The required change, if I'm not mistaken, would be
> >> for tags to not permit fast-forward updates while all other references
> >> would be pushed normally. From my brief and un-enlightened look at the
> >> push code I can't see that being as easy as it sounds.
> > I think the patch below obtains the requested behaviour:
Show 10 quoted lines
> > diff --git a/remote.c b/remote.c
> > index 04fd9ea..7fcb51e 100644
> > --- a/remote.c
> > +++ b/remote.c
> > @@ -1320,7 +1320,7 @@ void set_ref_status_for_push(struct ref *remote_refs, int send_mirror,
> >                         !ref->deletion &&
> >                         !is_null_sha1(ref->old_sha1) &&
> >                         (!has_sha1_file(ref->old_sha1)
> > -                         || !ref_newer(ref->new_sha1, ref->old_sha1));
> > +                         || !prefixcmp(ref->name, "refs/tags") || !ref_newer(ref->new_sha1, ref->old_sha1));
> >                 if (ref->nonfastforward && !ref->force && !force_update) {
> >                         ref->status = REF_STATUS_REJECT_NONFASTFORWARD;
> > --
> >   Kacper Kornet
> Kacper,
> I obviously didn't dig deep enough. In any case, I presume that's what
> he's asking for. I can't remember if git is still forcing tags to
> always be located in "refs/tags" however. I didn't think it was.
I have based my assumption about location of tags on gitglossary:
tag
 A ref under refs/tags/ namespace that points to an object of an
 arbitrary type (typically a tag points to either a tag or a commit
 object).
-- 
  Kacper
Previous: Drew NorthupNext: Angelo Borsotti
Message 13 of 35 in “git push tags”
  1. Angelo BorsottiOct 25, 2012
  2. Drew NorthupOct 25, 2012
  3. Angelo BorsottiOct 25, 2012
  4. Drew NorthupOct 25, 2012
  5. Angelo BorsottiOct 26, 2012
  6. Drew NorthupOct 26, 2012
  7. Chris RorvickOct 26, 2012
  8. Drew NorthupOct 26, 2012
  9. Chris RorvickOct 26, 2012
  10. Angelo BorsottiOct 26, 2012
  11. Kacper KornetOct 26, 2012
  12. Drew NorthupOct 26, 2012
  13. Kacper KornetOct 26, 2012
  14. Angelo BorsottiOct 26, 2012
  15. Kacper KornetOct 26, 2012
  16. Drew NorthupOct 26, 2012
  17. Johannes SixtOct 28, 2012
  18. Chris RorvickOct 28, 2012
  19. Philip OakleyOct 28, 2012
  20. Drew NorthupOct 28, 2012
  21. Chris RorvickOct 29, 2012
  22. Angelo BorsottiOct 29, 2012
  23. Angelo BorsottiOct 29, 2012
  24. Michael HaggertyOct 29, 2012
  25. Jeff KingOct 29, 2012
  26. Drew NorthupOct 29, 2012
  27. Angelo BorsottiOct 29, 2012
  28. Jeff KingOct 29, 2012
  29. Drew NorthupOct 29, 2012
  30. Angelo BorsottiOct 29, 2012
  31. Kacper KornetOct 29, 2012
  32. Jeff KingOct 29, 2012
  33. Chris RorvickOct 30, 2012
  34. Kacper KornetOct 29, 2012
  35. Chris RorvickOct 30, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.