File tree 3 files changed +18
-2
lines changed
3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -218,6 +218,7 @@ Usage: `git-sim rebase <new-base>`
218
218
Usage: ` git-sim cherry-pick <commit> `
219
219
220
220
- Specify ` <commit> ` as a ref (branch name/tag) or commit ID to cherry-pick onto the active branch
221
+ - Supports editing the cherry-picked commit message with: ` $ git-sim cherry-pick <commit> -e "Edited commit message" `
221
222
222
223
![ git-sim-cherry-pick_01-05-23_22-23-08] ( https://user-images.githubusercontent.com/49353917/210942811-fa5155b1-4c6f-4afc-bea2-d39b4cd594aa.jpg )
223
224
Original file line number Diff line number Diff line change @@ -283,6 +283,12 @@ def main():
283
283
type = str ,
284
284
help = "The ref (branch/tag), or commit ID to simulate cherry-pick onto active branch" ,
285
285
)
286
+ cherrypick .add_argument (
287
+ "-e" ,
288
+ "--edit" ,
289
+ help = "Specify a new commit message for the cherry-picked commit" ,
290
+ type = str ,
291
+ )
286
292
287
293
if len (sys .argv ) == 1 :
288
294
parser .print_help ()
Original file line number Diff line number Diff line change @@ -30,7 +30,13 @@ def __init__(self, args: Namespace):
30
30
pass
31
31
32
32
def construct (self ):
33
- print ("Simulating: git " + self .args .subcommand + " " + self .args .commit [0 ])
33
+ print (
34
+ "Simulating: git "
35
+ + self .args .subcommand
36
+ + " "
37
+ + self .args .commit [0 ]
38
+ + ((' -e "' + self .args .edit + '"' ) if self .args .edit else "" )
39
+ )
34
40
35
41
if self .repo .active_branch .name in self .repo .git .branch (
36
42
"--contains" , self .args .commit [0 ]
@@ -51,7 +57,10 @@ def construct(self):
51
57
self .get_commits (start = self .args .commit [0 ])
52
58
self .parse_commits (self .commits [0 ], shift = 4 * m .DOWN )
53
59
self .center_frame_on_commit (self .orig_commits [0 ])
54
- self .setup_and_draw_parent (self .orig_commits [0 ], self .commits [0 ].message )
60
+ self .setup_and_draw_parent (
61
+ self .orig_commits [0 ],
62
+ self .args .edit if self .args .edit else self .commits [0 ].message ,
63
+ )
55
64
self .draw_arrow_between_commits (self .commits [0 ].hexsha , "abcdef" )
56
65
self .recenter_frame ()
57
66
self .scale_frame ()
You can’t perform that action at this time.
0 commit comments