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

Re: How to say HEAD~"all the way back - 1"

From
Bill Lear <rael@zopyra.com>
Date
Feb 22, 2007, 20:24 UTC
Message-ID
<17885.64501.15547.465411@lisa.zopyra.com>
In-Reply-To
<7vodnmdk8y.fsf@assigned-by-dhcp.cox.net>
On Thursday, February 22, 2007 at 12:12:45 (-0800) Junio C Hamano writes:
Show 23 quoted lines
>Bill Lear <rael@zopyra.com> writes:
>
>> Git "indexing" of commits has a way to "go back":
>>
>> % git diff HEAD~3
>>
>> Can I say "all the way back", or "all the way back - 1" somehow?
>
>Sorry, there is no such shorthand, but you could obviously say:
>
>	$ git rev-list --parents HEAD | grep -v ' '
>
>A way to find the root commit seems to be one of the things
>people new to git want at least once, once they start futzing
>with the tool.  But I suspect that is only because they need
>that information to see how the tool works (say "what different
>output would I get out of 'git show $commit' for root and other
>commits?"), and not because they need that information for any
>real life use.
>
>Really, what useful purpose does it serve for you to find out
>the root commit, OTHER THAN being able to say "the development
>history of this project starts at this commit"?

Just today, I got a bug report from one of our developers. The git update hook we had in place before the conversion to 1.5 had this:

chmod -R ug+w $GIT_DIR

to avoid problems when people used 'git ssh://...", due to different umasks (yeah, a hack).

So, moving to 1.5, I updated our script (and, had been updating it for quite some time, so many revisions, maybe 20 or so), and well, now when people use ssh, they leave behind directories others can't read (as git now allows push through "git://", we'll be weaning people off of ssh soon).

So, I wanted to say "give me the first version of this, so I can cut-n-paste the chmod command, since I can't remember if it was chmod, or chown, or some combination ...", and thus the desire to to:

% git log -p HEAD~"All the way back" update
or something similar.
Bill
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 10 in “How to say HEAD~"all the way back - 1"”
  1. Bill LearFeb 22, 2007
  2. Petr BaudisFeb 22, 2007
  3. Jakub NarebskiFeb 23, 2007
  4. Bill LearFeb 23, 2007
  5. Junio C HamanoFeb 24, 2007
  6. Junio C HamanoFeb 22, 2007
  7. Bill LearFeb 22, 2007
  8. Junio C HamanoFeb 22, 2007
  9. J. Bruce FieldsFeb 22, 2007
  10. Johannes SchindelinFeb 22, 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.