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

Re: Memory overrun in http-push.c

From
APAndy Parkins <andyparkins@gmail.com>
Date
Mar 2, 2007, 10:05 UTC
Message-ID
<200703021005.13620.andyparkins@gmail.com>
In-Reply-To
<Pine.LNX.4.63.0703012140370.22628@wbgn013.biozentrum.uni-wuerzburg.de>
On Thursday 2007 March 01 20:43, Johannes Schindelin wrote:
Show 5 quoted lines
> > Putting $Id$ $Rev$ in a git managed file would have far more meaning
> > that it does in a CVS managed file.
>
> No. My point was that you do not even have to have an id. The hash of the
> object is the id.

I think you're thinking of these tags in too strict terms. You're right they aren't /needed/ you can query the version control system for the information. However, if you sent them out in a tarball to someone who didn't have or want to have your version control system, then it is much easier for them to be able to tell you the $Id$ field from the file itself than to generate the hash or send you a copy of the file.

They're purely for information. As I've mentioned before, personally the only place I use them is in inkscape SVG files (thank the lord SVG's are ASCII), where I add a text field that appears on the diagram itself and I write $Id$ as the text. Then whenever I print that diagram out (which makes it much harder to hash), I will know which version of the file I'm looking at. This is the /only/ thing I miss from subversion.

> This is obviously much better than the mess of CVS/SVN's file ids. There
> is an option, even, to switch off key expansion, so you can have erroneous
> ids. That just cannot happen with hashes.

As I said, I don't think anyone ever imagines that these Id fields are absolute guarantees of correctness - nor does any version control system /ever/ read them and use them. They are there only as a convenience for the user. Obviously, I could just edit the $Id$ anyway if I wanted, so it obviously isn't absolute.

> Of course, it does not give you any hint about when this file was current.
> But there is no way to tell in distributed development _anyway_. You have
> to look it up, when, and who, changed the file to the current state.
What about this though:
 * Tag a release
 * Export the working tree into a fresh directory
 * Edit each source file to put the hash of the tagged revision into
   every file.
 * Edit the makefile to include the tag hash in the released version
 * tar it up
 * Release
It's such a mundane, useless waste of time to edit the hash in by hand - why 
can't the version control system do it?

It's already nearly there in the form of git-describe. It's only purpose is to supply strings that describe the current revision. Well, so would $Id$, but for files instead.

I don't see that keywords are the evil they're made out to be; they're for convenience, not for absolute truth. When some random printout of the source turns up, at least the $Id$ might give you a clue as to which version it is. If it doesn't, well you're no worse off.

Here's another similar idea: generating copyright lines. Let's say we want to copyright every source file - that means writing "(C) Junio, (C) Johannes, etc" at the top of every file. Wouldn't it be nicer if we could put $Copyright$ in the file, then have some git-blame-like machinery fill in the copyrights automatically based on who's made contributions?

e.g.
 git-blame refs.c | sort -f 2 | uniq -c -s 10 -w 10 | sort -nr
Andy
-- 
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@gmail.com
Previous: Johannes SchindelinNext: Jakub Narebski
Message 20 of 39 in “Memory overrun in http-push.c”
  1. Eygene RyabinkinFeb 28, 2007
  2. Andy ParkinsFeb 28, 2007
  3. Johannes SchindelinFeb 28, 2007
  4. Eygene RyabinkinMar 1, 2007
  5. Alex RiesenMar 1, 2007
  6. Eygene RyabinkinMar 1, 2007
  7. Alex RiesenMar 1, 2007
  8. Eygene RyabinkinMar 1, 2007
  9. Junio C HamanoMar 1, 2007
  10. Alex RiesenMar 1, 2007
  11. Andy ParkinsMar 1, 2007
  12. Eygene RyabinkinMar 1, 2007
  13. Junio C HamanoMar 1, 2007
  14. Eygene RyabinkinMar 1, 2007
  15. Johannes SchindelinMar 1, 2007
  16. Andy ParkinsMar 1, 2007
  17. Johannes SchindelinMar 1, 2007
  18. Andy ParkinsMar 1, 2007
  19. Johannes SchindelinMar 1, 2007
  20. Andy ParkinsMar 2, 2007
  21. Jakub NarebskiMar 2, 2007
  22. Andy ParkinsMar 2, 2007
  23. Johannes SchindelinMar 2, 2007
  24. Andy ParkinsMar 2, 2007
  25. Daniel BarkalowMar 4, 2007
  26. Junio C HamanoMar 4, 2007
  27. Daniel BarkalowMar 4, 2007
  28. Alex RiesenMar 1, 2007
  29. Shawn O. PearceMar 1, 2007
  30. Uwe Kleine-KönigMar 1, 2007
  31. Jakub NarebskiMar 2, 2007
  32. Johannes SchindelinMar 2, 2007
  33. identifying blobs (was Re: Memory overrun in http-push.c)Junio C Hamano, Mar 2, 2007
  34. Linus TorvaldsMar 2, 2007
  35. Andy ParkinsMar 2, 2007
  36. Matthieu MoyMar 2, 2007
  37. Andy ParkinsMar 2, 2007
  38. Florian WeimerFeb 28, 2007
  39. Eygene RyabinkinMar 1, 2007

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.