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

Re: [PATCH 2/2] contrib/git-jump: add mode commit

From
Jeff King <peff@peff.net>
Date
Dec 21, 2019, 19:23 UTC
Message-ID
<20191221192348.GA3339249@coredump.intra.peff.net>
In-Reply-To
<20191221113846.169538-2-dev+git@drbeat.li>
On Sat, Dec 21, 2019 at 12:38:46PM +0100, Beat Bolli wrote:
> After committing, I often want to return to the place of the latest
> change to continue my work. Add the new mode "commit" which does exactly
> this.

That's one of my primary uses for git-jump, too. But you can already do that by jumping to the diff of HEAD^. Which has the additional advantage that it's a diff against the working tree. So if you did a partial commit, the diff will include any leftover changes.

So I'm not opposed to this patch per se, given that it's not very many lines. But I'm not sure I see much advantage over "git jump diff HEAD^". It's slightly less typing, but I already alias "git jump diff" since it's so long.

> Optional arguments are given to the "git show" call. So it's possible to
> jump to changes of other commits than HEAD.

This can also be done with "git jump diff $commit^ $commit". However, I've found that jumping based on older diffs is mostly useless, because the line numbers at $commit and those in the working tree don't always match up (and inherently you're always jumping in the working tree copy).

-Peff
Previous: Beat BolliNext: Beat Bolli
Message 3 of 4 in “contrib/git-jump: extract function diff_to_quickfix”
  1. 1/2 contrib/git-jump: extract function diff_to_quickfixBeat Bolli, Dec 21, 2019
  2. 2/2 contrib/git-jump: add mode commitBeat Bolli, Dec 21, 2019
  3. Jeff KingDec 21, 2019
  4. Beat BolliDec 22, 2019

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.