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

Re: git-svn and huge data and modifying the git-svn-HEAD branch directly

From
JWJosef Weidendorfer <josef.weidendorfer@gmx.de>
Date
Mar 1, 2006, 20:54 UTC
Message-ID
<200603012154.16509.Josef.Weidendorfer@gmx.de>
In-Reply-To
<7virqyf094.fsf@assigned-by-dhcp.cox.net>
On Wednesday 01 March 2006 20:11, Junio C Hamano wrote:
Show 13 quoted lines
> The latter at first sounds sane, but it has a subtle issue,
> which was what bitten me previously between heads/ and tags/.
> In that broken version, if you have a head called "dead" and a
> tag with the same name, neither was taken ("they are not unique,
> so do not take either!") and we ended up finding an object whose
> SHA1 name began with those two bytes 0xDE 0xAD.  I do not think
> this has happened in the field, fortunately, but it would have
> been quite hard to diagnose.
> 
> So if we were to do it, I would say do the latter, but be very
> careful to make sure you fail the whole get_sha1() when you bail
> out of the "try possible prefixes" codepath because of
> ambiguity.

Yes. Any ambiguity is a source of confusion and user error. Better bail out. If it is not a performance problem, it would be better to integrate the check for abbreviated object name into the ambiguity analysis, and not have 2 stages of searching. It probably would be a good idea to print out the ambigous names with the error message, so that you can copy&paste the correct full name afterwards.

If we go for the .git/refs/remotes/... and have an ambiguity becaues of remote shortcut names, a error message pointing at a "git-rename-remote" command would be handy, allowing the user to cleanup the namespace.

Show 5 quoted lines
> There may be other issues involved, but I wouldn't 
> know -- I reverted the "do not take either if they are
> ambiguous between heads/ and tags/" patch primarily because of
> the reason from the above paragraph, but also did not want to
> deal with any other potential issues to keep my sanity ;-).

I think the real problem here is that names like "dead" can be interpreted as abbreviated object name. When you introduce such a name as head or tag, you have a potential ambiguity which can get real at any time. Perhaps it would be good to print out a warning when the user is about to create a head or tag name which can be interpreted as abbreviated object name?

Josef
Previous: Junio C HamanoNext: Martin Langhoff
Message 21 of 33 in “git-svn and huge data and modifying the git-svn-HEAD branch directly”
  1. Nicolas Vilz 'niv'Feb 27, 2006
  2. Eric WongFeb 27, 2006
  3. Jan HarkesFeb 27, 2006
  4. Eric WongFeb 27, 2006
  5. Martin LanghoffFeb 28, 2006
  6. Linus TorvaldsFeb 28, 2006
  7. Martin LanghoffFeb 28, 2006
  8. Eric WongMar 1, 2006
  9. Andreas EricssonMar 1, 2006
  10. Linus TorvaldsMar 1, 2006
  11. Andreas EricssonMar 1, 2006
  12. Linus TorvaldsMar 1, 2006
  13. Josef WeidendorferMar 1, 2006
  14. Shawn PearceMar 1, 2006
  15. Linus TorvaldsMar 1, 2006
  16. Josef WeidendorferMar 1, 2006
  17. Linus TorvaldsMar 1, 2006
  18. Josef WeidendorferMar 1, 2006
  19. Linus TorvaldsMar 1, 2006
  20. Junio C HamanoMar 1, 2006
  21. Josef WeidendorferMar 1, 2006
  22. Martin LanghoffMar 1, 2006
  23. Carl WorthMar 1, 2006
  24. Linus TorvaldsMar 1, 2006
  25. Johannes SchindelinMar 1, 2006
  26. Petr BaudisMar 19, 2006
  27. Linus TorvaldsMar 19, 2006
  28. Junio C HamanoMar 19, 2006
  29. contrib/git-svn: tell the user to not modify git-svn-HEAD directlyEric Wong, Feb 27, 2006
  30. Nicolas Vilz 'niv'Feb 27, 2006
  31. Eric WongFeb 27, 2006
  32. Nicolas Vilz 'niv'Feb 27, 2006
  33. contrib/git-svn: correct commit example in manpageEric Wong, Feb 27, 2006

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.