Git development
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Geoffrey Thomas <geofft@ldpreload.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/1] git jump: support show
Date: Wed, 14 Aug 2024 20:42:48 -0400	[thread overview]
Message-ID: <20240815004248.GA2629889@coredump.intra.peff.net> (raw)
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

      parent reply	other threads:[~2024-08-15  0:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-14 20:07 [PATCH 1/1] git jump: support show Geoffrey Thomas
2024-08-14 21:10 ` Eric Sunshine
2024-08-15  0:42 ` Jeff King [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240815004248.GA2629889@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=geofft@ldpreload.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox