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

Re: Dropping '+' from fetch = +refs/heads/*:refs/remotes/origin/*?

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Sep 1, 2011, 19:20 UTC
Message-ID
<4E5FDAFE.6050004@drmicha.warpmail.net>
In-Reply-To
<7vliu8w25g.fsf@alter.siamese.dyndns.org>
Junio C Hamano venit, vidit, dixit 01.09.2011 20:25:
Show 28 quoted lines
> Suggested reading:
> 
>   http://git-blame.blogspot.com/2011/08/how-to-inject-malicious-commit-to-git.html
> 
> I am wondering if we are better off applying something along the lines of
> this patch, so that with the default configuration, users can notice if
> their upstream unexpectedly rewound their branches.
> 
> It would produce
> 
> 	[remote]
>         	url = git://.../git.git/
>                 fetch = refs/heads/*:refs/remotes/origin/*
> 
> upon cloning from my repository, and your "git fetch" will fail because
> the pu (proposed updates) branch is constantly unwinding, but that can be
> easily fixed with
> 
> 
> 	[remote]
>         	url = git://.../git.git/
>                 fetch = refs/heads/*:refs/remotes/origin/*
>                 fetch = +refs/heads/pu:refs/remotes/origin/pu
> 
> as the explicit refspec trumps the wildcard one.
> 
>  builtin/remote.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)

My first thought was "Oh no", even though I saw it coming since I read your blog entry. But I realized that it was probably due to the usual inertia when habits have to change.

Thinking more about it, we try to encourage a workflow where locally history may be rewritten a lot, and distribution points fast-forward only. We have defaults and settings to discourage (pushes to checked out branches and) non-ff pushes, for example. So I think the above change is pretty much in line with that reasoning.

The kernel.org problems gave git some pretty good PR even without that change, but with it we have an even stronger stop put in. On the other hand, adding "+" to the config for "pu" (and peff...) isn't that much of an issue, though we might also want "fetch -f" as an override - I guess we have that already.

Plus fetch with fsck, yes.
To
"I don't need backups, I let others clone."
add
"I don't need intrusion detection, I let others fetch."
;)
Michael
Previous: Shawn PearceNext: Matthieu Moy
Message 4 of 27 in “Dropping '+' from fetch = +refs/heads/*:refs/remotes/origin/*?”
  1. Junio C HamanoSep 1, 2011
  2. Junio C HamanoSep 1, 2011
  3. Shawn PearceSep 1, 2011
  4. Michael J GruberSep 1, 2011
  5. Matthieu MoySep 1, 2011
  6. Shawn PearceSep 1, 2011
  7. Matthieu MoySep 2, 2011
  8. Jeff KingSep 2, 2011
  9. Johannes SixtSep 2, 2011
  10. Jeff KingSep 2, 2011
  11. Michael J GruberSep 2, 2011
  12. Jeff KingSep 2, 2011
  13. Junio C HamanoSep 2, 2011
  14. Jeff KingSep 2, 2011
  15. Junio C HamanoSep 2, 2011
  16. Shawn PearceSep 5, 2011
  17. Jeff KingSep 5, 2011
  18. Shawn PearceSep 5, 2011
  19. Jeff KingSep 5, 2011
  20. Shawn PearceSep 5, 2011
  21. fetch: bigger forced-update warningsJeff King, Sep 7, 2011
  22. Shawn PearceSep 7, 2011
  23. Junio C HamanoSep 7, 2011
  24. Jeff KingSep 7, 2011
  25. Thomas RastSep 7, 2011
  26. Matthieu MoySep 6, 2011
  27. Michael J GruberSep 6, 2011

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.