git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Beat Bolli <dev+git@drbeat.li>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/2] contrib/git-jump: add mode commit
Date: Sun, 22 Dec 2019 13:47:00 +0100	[thread overview]
Message-ID: <94d850de-cb73-e124-bced-4dc3f6b970a6@drbeat.li> (raw)
In-Reply-To: <20191221192348.GA3339249@coredump.intra.peff.net>

On 21.12.19 20:23, Jeff King wrote:
> 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).

Thanks, I didn't realize that git diff could just as well be used to
generate the diff of an arbitrary commit. I have added this new shortcut
to my bash aliases:

    gjc() { git jump diff ${1:-HEAD}^ ${1:-HEAD}; }


Cheers, Beat

WARNING: multiple messages have this Message-ID (diff)
From: Beat Bolli <dev+git@drbeat.li>
To: git@vger.kernel.org
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/2] contrib/git-jump: add mode commit
Date: Sun, 22 Dec 2019 13:47:00 +0100	[thread overview]
Message-ID: <94d850de-cb73-e124-bced-4dc3f6b970a6@drbeat.li> (raw)
Message-ID: <20191222124700.IMMzESxmZDvlpr7GAmGcKiprQeTTUFHyudEnwAb03E8@z> (raw)
In-Reply-To: <20191221192348.GA3339249@coredump.intra.peff.net>

On 21.12.19 20:23, Jeff King wrote:
> 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).

Thanks, I didn't realize that git diff could just as well be used to
generate the diff of an arbitrary commit. I have added this new shortcut
to my bash aliases:

    gjc() { git jump diff ${1:-HEAD}^ ${1:-HEAD}; }


Cheers, Beat


  reply	other threads:[~2019-12-22 12:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-21 11:38 [PATCH 1/2] contrib/git-jump: extract function diff_to_quickfix Beat Bolli
2019-12-21 11:38 ` [PATCH 2/2] contrib/git-jump: add mode commit Beat Bolli
2019-12-21 19:23   ` Jeff King
2019-12-22 12:47     ` Beat Bolli [this message]
2019-12-22 12:47       ` Beat Bolli

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=94d850de-cb73-e124-bced-4dc3f6b970a6@drbeat.li \
    --to=dev+git@drbeat.li \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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;
as well as URLs for NNTP newsgroup(s).