All of lore.kernel.org
 help / color / mirror / Atom feed
From: Timothy Eccleston <timothy.perisho.eccleston@gmail.com>
To: git@vger.kernel.org
Subject: Re: Unified workflow for `git add/checkout --patch`?
Date: Thu, 21 Oct 2021 15:19:38 -0700	[thread overview]
Message-ID: <CACYzLDcO4OATYYZ6AtJnJTKS9EKUKNRJY5_Rb=y62gWFFwoDhg@mail.gmail.com> (raw)
In-Reply-To: <CACYzLDcFjwaJkgVUemD_KqkoGhV_5OYrECddDuxa-o5FpZ6XMA@mail.gmail.com>

Hi,
I really like both these features:
- git add -p
- git checkout -p

My typical workflow
I like to use them after a long and complex coding sessions where I
want to double-check my work, making edits and adding sets of patches
into sequential commits to keep related changes together topically.

In the process of using git add -p to grab some patches, I may notice
other patches I don't want (especially after I've used the "e" command
in `git add -p` to edit a patch - I usually want to drop the
remaining, unstaged version of the patch right then). But, instead, I
have to go through git add -p and then git checkout -p and likely back
and forth several times, each time skipping through all the same
undecided or postponed patches I am waiting on for later.

Note: I recently discovered the "j" and "J" subcommands which are
useful to postpone decisions on certain patches, but only if I
restrict myself to just git add or git checkout. If I want to do both,
I still have to cycle back through from the top each time. I suppose I
could use stash -p to really hide patches I'm saving for later, but I
still have to exit my workflow and start another command, requiring
multiple passes. OTOH, a unified git add/checkout/stash --patch would
be amazing!

My request
It would be really nice if there were a unified command workflow where
I could add or checkout patches or even partial patches (after editing
a patch in git add), on a case by case basis in a single pass.

Does anyone know a way to do this or do you think it's worth making a
new feature in git to handle it?

Thanks!
Tim

       reply	other threads:[~2021-10-21 22:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CACYzLDcFjwaJkgVUemD_KqkoGhV_5OYrECddDuxa-o5FpZ6XMA@mail.gmail.com>
2021-10-21 22:19 ` Timothy Eccleston [this message]
2021-10-25 10:08   ` Unified workflow for `git add/checkout --patch`? Phillip Wood
2021-10-25 19:47     ` Timothy Eccleston

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='CACYzLDcO4OATYYZ6AtJnJTKS9EKUKNRJY5_Rb=y62gWFFwoDhg@mail.gmail.com' \
    --to=timothy.perisho.eccleston@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.