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

Re: On git 1.6 (novice's opinion)

From
Andreas Ericsson <ae@op5.se>
Date
Mar 30, 2009, 09:06 UTC
Message-ID
<49D08B8B.1000309@op5.se>
In-Reply-To
<49CC8C90.12268.242CEFCE@Ulrich.Windl.rkdvmks1.ngate.uni-regensburg.de>
Ulrich Windl wrote:
Show 5 quoted lines
> 
> 1) The ability to use the file's time at the time of add/commit instead of the
> current time, and the ability tho check outfiles with the times stored in the
> repository.
> 

You can set the time manually for each commit. I suppose it's not quite the same as doing it by taking the timestamp of a single file. Personally, I've never quite understood the point of it, since I always have to do at least *some* testing (even if it's only a compile-test) after I'm done editing so I know what I'm committing isn't totally broken.

Can you describe a use-case where this would be handy?
Show 5 quoted lines
> 2) Keyword substitution. I know it's controverse (dealing with binary files),
> but I'd like to have some automatic version numbering keyword at least:
> Initial idea is that every commit with a change increments the number by one,
> and when merging numbers a and b, the resulting number is max(a, b) + 1.
> 
This has been discussed to death, and it's much, much harier than just
handling binary files. Browse the list archives for the (many, lengthy and
sometimes heated) discussions on this topic. A quick recap of the outcome
of *ALL* such discussions is as follows, though:
1 It would potentially make git horribly slow at switching branches.
2 It's rarely interesting to version a single file, but always interesting
  to version the entire project (what do I care if README was v1,1 in CVS
  when what I *really* want to know is which version of the program I should
  file my bug-report against).
3 It's far better to set the version number in the release-process. Usually
  this can be done automatically by one invocation of "git describe", just
  as git.git does it.

We've adopted "3" full out at $dayjob. Our build-machinery gets the version number from the git tag (releases can only be built from signed tags), and it updates macros and whatnot used for informing the user which version he or she is running. This makes a lot more sense both from a bug-reporting and from a release process view than having generated version-numbers in files. On a side-note; When I told my co-workers I'd like us to switch to git, two of them asked about autoversioning features. I said there weren't any and asked them to name a single time when we've actually used them for anything *at all*. In a team of eight, having been programming for three years with 12 releases and about 800 bugreports + feature-requests, noone could mention a single time when the autogenerated version numbers had actually been used for anything.

Otoh, having the entire repository locally makes it painless to view the commit-log for an entire project (or parts of it) and see who changed what when and why, which is information that's actually *useful*.

> 3) "git undo": If possible undo the effects of the last command.
> 

Immensely complex to create, and the command would almost certainly cause more confusion than order before it can handle every single operation that a user would want to undo. Instead, the most common operations that require some form of user-interaction have an "--abort" switch which does roughly what a "git undo" command would.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.
Previous: Ulrich WindlNext: Ulrich Windl
Message 42 of 49 in “On git 1.6 (novice's opinion)”
  1. Ulrich WindlMar 27, 2009
  2. H.Merijn BrandMar 27, 2009
  3. Ulrich WindlMar 27, 2009
  4. Etienne Vallette d'OsiaMar 27, 2009
  5. Etienne Vallette d'OsiaMar 27, 2009
  6. Dmitry PotapovMar 27, 2009
  7. Ulrich WindlMar 27, 2009
  8. Matthieu MoyMar 27, 2009
  9. Etienne Vallette d'OsiaMar 27, 2009
  10. Ulrich WindlApr 1, 2009
  11. Matthieu MoyApr 1, 2009
  12. Junio C HamanoMar 28, 2009
  13. Junio C HamanoMar 28, 2009
  14. Dmitry PotapovMar 28, 2009
  15. Russ DillMar 30, 2009
  16. Ulrich WindlApr 1, 2009
  17. Andreas EricssonApr 1, 2009
  18. Ulrich WindlApr 1, 2009
  19. Andreas EricssonApr 1, 2009
  20. Heiko VoigtApr 1, 2009
  21. Dmitry PotapovMar 27, 2009
  22. Ulrich WindlMar 27, 2009
  23. Matthieu MoyMar 27, 2009
  24. Ulrich WindlApr 1, 2009
  25. Matthieu MoyApr 1, 2009
  26. Michael J GruberMar 27, 2009
  27. Ulrich WindlMar 27, 2009
  28. Jakub NarebskiMar 27, 2009
  29. Ulrich WindlApr 1, 2009
  30. Andreas EricssonApr 1, 2009
  31. Matthieu MoyApr 1, 2009
  32. Ulrich WindlApr 1, 2009
  33. Andreas EricssonApr 1, 2009
  34. Jakub NarebskiApr 2, 2009
  35. demerphqMar 28, 2009
  36. Junio C HamanoMar 28, 2009
  37. Ulrich WindlApr 1, 2009
  38. Bryan DonlanMar 29, 2009
  39. Johannes SchindelinMar 29, 2009
  40. Ulrich WindlApr 1, 2009
  41. Ulrich WindlApr 1, 2009
  42. Andreas EricssonMar 30, 2009
  43. Ulrich WindlApr 1, 2009
  44. Andreas EricssonApr 1, 2009
  45. Ulrich WindlApr 1, 2009
  46. Andreas EricssonApr 1, 2009
  47. Ulrich WindlApr 1, 2009
  48. Andreas EricssonApr 1, 2009
  49. Kris ShannonApr 1, 2009

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.