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

Re: Git Questions

From
Jeff King <peff@peff.net>
Date
Aug 20, 2007, 10:06 UTC
Message-ID
<20070820100600.GA26843@coredump.intra.peff.net>
In-Reply-To
<1187603749.11595.10.camel@tom-desktop>
On Mon, Aug 20, 2007 at 07:25:48PM +0930, Tom Schinckel wrote:
> Is it possible to change the revision numbers from long hashes to normal
> numbers (i.e, 0001 for first, 0002 for the second)

No, they are a fundamental part of the way git works. However, there are a few ways you can avoid using the hashes:

 - tag your commits with readable names
 - use git's syntax for relative commits (e.g., "git-show HEAD~20") will
   show you 20 commits back from the current commit (where back is
   defined by following the first parent of each commit)
> a) Automatically commit a file to the repository every time it's saved

If you want git to notice when files are changed and commit them, then no. You can probably configure your editor (or whatever is saving the file) to trigger a 'git-add && git-commit'. But keep in mind this will produce a lot of commits with lousy commit messages.

> b) Automatically use the default hashed-out bit:

There isn't an argument to git-commit to do this, but you can get the same message from git-status. So you could do something like:

git-status | sed 's/^# //' | git-commit -F -
-Peff
Previous: Tom SchinckelNext: David Kågedal
Message 2 of 9 in “Git Questions”
  1. Tom SchinckelAug 20, 2007
  2. Jeff KingAug 20, 2007
  3. David KågedalAug 20, 2007
  4. Tom SchinckelAug 20, 2007
  5. Andy ParkinsAug 20, 2007
  6. David TweedAug 20, 2007
  7. Jan HudecAug 20, 2007
  8. Matthieu MoyAug 20, 2007
  9. David TweedAug 20, 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.