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

Re: [PATCH 1/1] git jump: support show

From
Jeff King <peff@peff.net>
Date
Aug 15, 2024, 00:42 UTC
Message-ID
<20240815004248.GA2629889@coredump.intra.peff.net>
In-Reply-To
<20240814200709.53450-1-geofft@ldpreload.com>
On Wed, Aug 14, 2024 at 04:07:09PM -0400, Geoffrey Thomas wrote:
> This makes it easy to go to the changes in the latest commit, or a
> previous named commit, to fix a bug and commit a fixup, to respond to
> code review feedback, etc.

One trouble with this approach is that you're analyzing a diff whose endpoint is something other than the current working tree. So the line numbers in the diff do not necessarily correspond to what you're going to open in the editor.

For something like the changes in the latest commit, I'd usually do "git jump diff HEAD^", which I think is strictly better than a "show" on the latest commit.

For looking at older commits that doesn't work, though. And if they're not _too_ old, then you've got a reasonable chance of ending up somewhere useful. So I'm not opposed to this patch. As Eric mentioned, we'd probably want an update to the README. And I think it should mention the caveat that the post-image of the diff you're viewing won't necessarily match the working tree.

-Peff
Previous: Eric Sunshine
Message 3 of 3 in “git jump: support show”
  1. 1/1 git jump: support showGeoffrey Thomas, Aug 14, 2024
  2. Eric SunshineAug 14, 2024
  3. Jeff KingAug 15, 2024

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.