git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] commit: restore --edit when combined with --fixup
@ 2021-08-11 13:49 Joel Klinghed via GitGitGadget
  2021-08-11 20:24 ` Jeff King
  2021-08-11 23:43 ` [PATCH v2] " Joel Klinghed via GitGitGadget
  0 siblings, 2 replies; 19+ messages in thread
From: Joel Klinghed via GitGitGadget @ 2021-08-11 13:49 UTC (permalink / raw)
  To: git; +Cc: Joel Klinghed, Joel Klinghed

From: Joel Klinghed <the_jk@spawned.biz>

Recent changes to --fixup, adding amend suboption, caused the
--edit flag to be ignored as use_editor was always set to zero.

Restore edit_flag having higher priority than fixup_message when
deciding the value of use_editor by only changing the default
if edit_flag is not set.

Signed-off-by: Joel Klinghed <the_jk@spawned.biz>
---
    commit: restore --edit when combined with --fixup
    
    Recent changes to --fixup, adding amend suboption, caused the --edit
    flag to be ignored as use_editor was always set to zero.
    
    Restore edit_flag having higher priority than fixup_message when
    deciding the value of use_editor by only changing the default if
    edit_flag is not set.
    
    Signed-off-by: Joel Klinghed the_jk@spawned.biz

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1014%2Fthejk%2Ffixup_edit-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1014/thejk/fixup_edit-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1014

 builtin/commit.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/builtin/commit.c b/builtin/commit.c
index 190d215d43b..4c5286840c5 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1333,7 +1333,8 @@ static int parse_and_validate_options(int argc, const char *argv[],
 		} else {
 			fixup_commit = fixup_message;
 			fixup_prefix = "fixup";
-			use_editor = 0;
+			if (0 > edit_flag)
+				use_editor = 0;
 		}
 	}
 

base-commit: ebf3c04b262aa27fbb97f8a0156c2347fecafafb
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2021-08-17 10:08 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-11 13:49 [PATCH] commit: restore --edit when combined with --fixup Joel Klinghed via GitGitGadget
2021-08-11 20:24 ` Jeff King
2021-08-11 22:10   ` Joel Klinghed
2021-08-11 22:22     ` Jeff King
2021-08-11 23:27     ` brian m. carlson
2021-08-11 23:43 ` [PATCH v2] " Joel Klinghed via GitGitGadget
2021-08-12  5:21   ` Junio C Hamano
2021-08-12  7:42     ` Joel Klinghed
2021-08-12 19:51       ` Junio C Hamano
2021-08-12  8:02   ` [PATCH v3] " Joel Klinghed via GitGitGadget
2021-08-12  9:32     ` Phillip Wood
2021-08-12 10:01       ` Joel Klinghed
2021-08-13 13:06         ` Phillip Wood
2021-08-13 15:35           ` Joel Klinghed
2021-08-14 15:20             ` Phillip Wood
2021-08-14 21:19               ` Joel Klinghed
2021-08-12 11:55     ` [PATCH v4] " Joel Klinghed via GitGitGadget
2021-08-14 21:40       ` [PATCH v5] " Joel Klinghed via GitGitGadget
2021-08-17 10:06         ` Phillip Wood

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).