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

Re: confusion over the new branch and merge config

From
APAndy Parkins <andyparkins@gmail.com>
Date
Dec 22, 2006, 08:31 UTC
Message-ID
<200612220831.26497.andyparkins@gmail.com>
In-Reply-To
<7vvek492q1.fsf@assigned-by-dhcp.cox.net>
On Friday 2006 December 22 00:46, Junio C Hamano wrote:
> You can always say "git log refs/heads/next" even though you are
> allowed to say "git log next".  Maybe we should remove that
> shorthand to make it consistent?   I think not.

On a related subject - I'd like to remove all the "refs/" literals from git. All refs are always under "refs/", so prefixing everything with refs/ is just noise.

The place that makes it stand out that this is wrong is (I think) found in refs.c (excuse my abuse of syntax):

int for_each_ref(each_ref_fn fn, void *cb_data)
    return do_for_each_ref("refs/", fn, 0, cb_data);
int for_each_tag_ref(each_ref_fn fn, void *cb_data)
    return do_for_each_ref("refs/tags/", fn, 10, cb_data);
int for_each_branch_ref(each_ref_fn fn, void *cb_data)
    return do_for_each_ref("refs/heads/", fn, 11, cb_data);
int for_each_remote_ref(each_ref_fn fn, void *cb_data)
    return do_for_each_ref("refs/remotes/", fn, 13, cb_data);
What's significant is that it is only for_each_ref() that hands the prefix 
back.  The change I'd like to make is 
    return do_for_each_ref("refs/", fn, 5, cb_data);

Obviously, this will imply a lot of changes everywhere else; so I didn't want to dive into it without mentioning it here first.

Is this a sensible thing to want to do?  

As I'm talking about code cleanups, I'd also like to change all variables called "sha1" to "hash" (or similar). The point being that the variables hold hashes not sha1's.

I don't say that the above are serious problems, I just like cleaning code :-)
Andy
-- 
Dr Andy Parkins, M Eng (hons), MIEE
andyparkins@gmail.com
Previous: SeanNext: Alan Chandler
Message 7 of 45 in “confusion over the new branch and merge config”
  1. Nicolas PitreDec 21, 2006
  2. Junio C HamanoDec 21, 2006
  3. SeanDec 21, 2006
  4. Junio C HamanoDec 22, 2006
  5. Junio C HamanoDec 22, 2006
  6. SeanDec 22, 2006
  7. Andy ParkinsDec 22, 2006
  8. Alan ChandlerDec 22, 2006
  9. Junio C HamanoDec 22, 2006
  10. Andy ParkinsDec 22, 2006
  11. Alan ChandlerDec 22, 2006
  12. Nicolas PitreDec 22, 2006
  13. Jakub NarebskiDec 22, 2006
  14. Nicolas PitreDec 22, 2006
  15. Jakub NarebskiDec 22, 2006
  16. Junio C HamanoDec 22, 2006
  17. Tom PrinceDec 23, 2006
  18. Nicolas PitreDec 23, 2006
  19. Jeff KingDec 23, 2006
  20. Nicolas PitreDec 23, 2006
  21. Junio C HamanoDec 23, 2006
  22. Shawn PearceDec 23, 2006
  23. Jeff KingDec 23, 2006
  24. Junio C HamanoDec 23, 2006
  25. Jeff KingDec 23, 2006
  26. Junio C HamanoDec 23, 2006
  27. Jakub NarebskiDec 23, 2006
  28. Johannes SchindelinDec 23, 2006
  29. Jakub NarebskiDec 23, 2006
  30. Jeff KingDec 24, 2006
  31. Nicolas PitreDec 24, 2006
  32. Jeff KingDec 26, 2006
  33. Jeff KingJan 2, 2007
  34. Junio C HamanoJan 2, 2007
  35. Jeff KingJan 2, 2007
  36. Junio C HamanoJan 2, 2007
  37. Jakub NarebskiJan 2, 2007
  38. Santi BéjarJan 3, 2007
  39. Jakub NarebskiJan 3, 2007
  40. Jeff KingJan 9, 2007
  41. Jeff KingJan 9, 2007
  42. Jakub NarebskiDec 23, 2006
  43. Andy ParkinsDec 22, 2006
  44. Lars HjemliDec 22, 2006
  45. Nicolas PitreDec 22, 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.