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

Re: Real-life kernel debugging scenario

From
Linus Torvalds <torvalds@osdl.org>
Date
Nov 9, 2005, 18:36 UTC
Message-ID
<Pine.LNX.4.64.0511091028241.3247@g5.osdl.org>
In-Reply-To
<Pine.LNX.4.64.0511090901370.6744@x2.ybpnyarg>
On Wed, 9 Nov 2005, wa1ter@myrealbox.com wrote:
> 
> The built-in variable ORIG_HEAD isn't explained anywhere AFAICT, or at
> least it wasn't until today.  Are there other such magic variables which
> might be useful for us to know about?
No, ORIG_HEAD is pretty much it.

There's a few special files that a non-committed merge leaves around (either because you asked it to not be committed, or because it had clashes and requires manual fixing), but they are not normally useful to any regular people. You can poke around in the ".git" directory after such a merge if you want (MERGE_HEAD, MERGE_MSG).

ORIG_HEAD is _very_ useful, though, and I use it all the time. Any time you've pulled something from somebody else, and you wonder what you pulled, just go

	gitk ORIG_HEAD..

and you'll see exactly what new stuff you got in your branch. I often do that command line several times a day as I merge stuff. Otherwise the new stuff tends to be hidden in the noise.

(There's also FETCH_HEAD, which is the head of the last fetch, so if you aren't interested in any potential merge, you could instead use the range ORIG_HEAD..FETCH_HEAD, but quite frankly, I doubt anybody really cares except for the internal git fetching/pulling logic).

		Linus
Previous: Jon Loeliger
Message 7 of 7 in “Real-life kernel debugging scenario”
  1. waltNov 8, 2005
  2. David LangNov 8, 2005
  3. Junio C HamanoNov 8, 2005
  4. Linus TorvaldsNov 8, 2005
  5. wa1ter@myrealbox.comNov 9, 2005
  6. Jon LoeligerNov 9, 2005
  7. Linus TorvaldsNov 9, 2005

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.