-
Notifications
You must be signed in to change notification settings - Fork 26.7k
sequencer: fix edit handling for cherry-pick and revert messages #988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
58cf9ba
to
30cdc3c
Compare
This comment was marked as off-topic.
This comment was marked as off-topic.
/submit |
Submitted as pull.988.git.git.1616742969145.gitgitgadget@gmail.com To fetch this version into
To fetch this version to local tag
|
On the Git mailing list, Philip Oakley wrote (reply to this):
|
User |
On the Git mailing list, Elijah Newren wrote (reply to this):
|
User |
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
This branch is now known as |
This patch series was integrated into seen via 21b06d6. |
This patch series was integrated into seen via 1a2053d. |
On the Git mailing list, Phillip Wood wrote (reply to this):
|
User |
30cdc3c
to
376799b
Compare
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, Elijah Newren wrote (reply to this):
|
This patch series was integrated into seen via 12ef56b. |
/submit |
Submitted as pull.988.v2.git.git.1617070174458.gitgitgadget@gmail.com To fetch this version into
To fetch this version to local tag
|
This patch series was integrated into seen via 404c7e2. |
On the Git mailing list, Johannes Schindelin wrote (reply to this):
|
User |
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, Elijah Newren wrote (reply to this):
|
On the Git mailing list, Elijah Newren wrote (reply to this):
|
This patch series was integrated into seen via 2e4fbfc. |
There was a status update about the branch |
save_opts() should save any non-default values. It was intended to do this, but since most options in struct replay_opts default to 0, it only saved non-zero values. Unfortunately, this does not always work for options.edit. Roughly speaking, options.edit had a default value of 0 for cherry-pick but a default value of 1 for revert. Make save_opts() record a value whenever it differs from the default. options.edit was also overly simplistic; we had more than two cases. The behavior that previously existed was as follows: Non-conflict commits Right after Conflict revert Edit iff isatty(0) Edit (ignore isatty(0)) cherry-pick No edit See above Specify --edit Edit (ignore isatty(0)) See above Specify --no-edit (*) See above (*) Before stopping for conflicts, No edit is the behavior. After stopping for conflicts, the --no-edit flag is not saved so see the first two rows. However, the expected behavior is: Non-conflict commits Right after Conflict revert Edit iff isatty(0) Edit iff isatty(0) cherry-pick No edit Edit iff isatty(0) Specify --edit Edit (ignore isatty(0)) Edit (ignore isatty(0)) Specify --no-edit No edit No edit In order to get the expected behavior, we need to change options.edit to a tri-state: unspecified, false, or true. When specified, we follow what it says. When unspecified, we need to check whether the current commit being created is resolving a conflict as well as consulting options.action and isatty(0). While at it, add a should_edit() utility function that compresses options.edit down to a boolean based on the additional information for the non-conflict case. continue_single_pick() is the function responsible for resuming after conflict cases, regardless of whether there is one commit being picked or many. Make this function stop assuming edit behavior in all cases, so that it can correctly handle !isatty(0) and specific requests to not edit the commit message. Reported-by: Renato Botelho <garga@freebsd.org> Signed-off-by: Elijah Newren <newren@gmail.com>
On the Git mailing list, Elijah Newren wrote (reply to this):
|
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
This comment has been minimized.
This comment has been minimized.
This patch series was integrated into seen via d0cd926. |
On the Git mailing list, Elijah Newren wrote (reply to this):
|
This patch series was integrated into seen via 3abfba5. |
This patch series was integrated into next via 2e3c705. |
On the Git mailing list, Phillip Wood wrote (reply to this):
|
On the Git mailing list, Phillip Wood wrote (reply to this):
|
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, Elijah Newren wrote (reply to this):
|
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
This patch series was integrated into seen via 3a1d1de. |
This patch series was integrated into seen via 9e94fef. |
There was a status update about the branch "git cherry-pick/revert" with or without "--[no-]edit" did not spawn the editor as expected (e.g. "revert --no-edit" after a conflict still asked to edit the message), which has been corrected. Will merge to 'master'. |
This patch series was integrated into seen via 8811573. |
On the Git mailing list, Johannes Schindelin wrote (reply to this):
|
On the Git mailing list, Junio C Hamano wrote (reply to this):
|
On the Git mailing list, Christian Couder wrote (reply to this):
|
User |
This patch series was integrated into seen via 021831e. |
This patch series was integrated into seen via 82fd285. |
This patch series was integrated into next via 82fd285. |
This patch series was integrated into master via 82fd285. |
Closed via 82fd285. |
On the Git mailing list, Johannes Schindelin wrote (reply to this):
|
Changes since v2:
Reported-by: Renato Botelho garga@freebsd.org
Signed-off-by: Elijah Newren newren@gmail.com
cc: Philip Oakley philipoakley@iee.email
cc: Elijah Newren newren@gmail.com
cc: Phillip Wood phillip.wood123@gmail.com
cc: Johannes Schindelin Johannes.Schindelin@gmx.de
cc: Ævar Arnfjörð Bjarmason avarab@gmail.com
cc: Christian Couder christian.couder@gmail.com