git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Edmundo Carmona Antoranz <eantoranz@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [RFC] sequencer: allow metadata to be saved if using cherry-pick --no-commit
Date: Wed, 21 Oct 2020 14:45:13 -0600	[thread overview]
Message-ID: <CAOc6etbSbg0rDrqu__MASTEdz2FhnhxtQLn6gvhBZL8BLz+AQQ@mail.gmail.com> (raw)
In-Reply-To: <xmqqv9f37476.fsf@gitster.c.googlers.com>

On Wed, Oct 21, 2020 at 1:46 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> So, personally, I am fairly negative on this line of change.  If the
> user says upfront "--no-commit", then user does not want a commit,
> so why should we even allow "--continue"?

This is the way merge --no-commit works, actually. You run
--no-commit, then you run merge --continue to wrap it up and that's
why to me it had always felt a bit off in terms of consistency of the
UI.

>
> Before dismissing the idea totally, let's see what potential use
> cases this change _could_ benefit, and see if there are already ways
> to satisfy these use cases without making this change.  For example,
> if the user wants to examine the result before actually "committing"
> to move the target branch forward with this change, keeping it an
> option to back out if the result of cherry-picking turns out to be
> bad, the "--no-commit first, examine, and --continue or --abort"
> sequence may help such a workflow.

Case in point, I am working on a script that corrects EOL format of
files in a branch. When I started developing it, I was trusting that I
could run cherry-pick --no-commit so that I could then check the exit
code of git to see if there had been problems or not in the operation.
If there were, I would correct the EOL format of the files. Then,
successful cherry-pick or not, I would run cherry-pick --no-commit and
it would work.... but that was when I realized that cherry-pick
--no-commit is not keeping the information. Given that --no-commit
_forgets_ the information from the revision, I have to run a normal
cherry-pick. If it fails, I correct the EOL format and then I run
cherry-pick --continue. It is noty like a game changer, you know... I
can live with it.... how many people have complained about it, anyway?
I just find it inconsistent in terms of how cherry-pick/merge
--no-commit behave.

https://github.com/eantoranz/conflict_book/blob/0385d240dda962512b215781039ed42ec2f12ec2/scripts/correct_eol.sh#L197

Anyway, thanks for all your feedback and let's see if there are more comments.

BR


>
> But the user can already do so without this change:
>
>     $ git checkout target_branch^0 ;#detach
>     $ git cherry-pick source_branch
>     ... examine the result ...
>     ... and if it is satisfactory ...
>     $ git checkout -B target_branch
>     ... or if it is not, then discard ...
>     $ git checkout target_branch
>
> > With this patch, we allow sequencer to save the metadata from the original
> > cherry-pick operation so that 'git cherry-pick --continue' can be called.
>

  parent reply	other threads:[~2020-10-21 20:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-21  6:24 [RFC] sequencer: allow metadata to be saved if using cherry-pick --no-commit Edmundo Carmona Antoranz
2020-10-21  6:31 ` Edmundo Carmona Antoranz
2020-10-21 16:12 ` Taylor Blau
2020-10-21 18:04   ` Edmundo Carmona Antoranz
2020-10-21 19:46 ` Junio C Hamano
2020-10-21 20:41   ` Junio C Hamano
2020-10-21 20:45   ` Edmundo Carmona Antoranz [this message]
2020-10-21 20:53     ` Edmundo Carmona Antoranz

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=CAOc6etbSbg0rDrqu__MASTEdz2FhnhxtQLn6gvhBZL8BLz+AQQ@mail.gmail.com \
    --to=eantoranz@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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).