File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -204,7 +204,7 @@ Usage: `git-sim restore <file 1> <file 2> ... <file n>`
204204Usage: ` git-sim commit -m "Commit message" `
205205
206206- Simulated output will show the new commit added to the tip of the active branch
207- - Specify your commit message after the -m option
207+ - Specify a commit message with the ` -m ` option
208208- HEAD and the active branch will be moved to the new commit
209209- Simulated output will show files in the staging area being included in the new commit
210210- Supports amending the last commit with: ` $ git-sim commit --amend -m "Amended commit message" `
@@ -256,12 +256,14 @@ Usage: `git-sim revert <to-revert>`
256256![ git-sim-revert_01-05-23_22-16-59] ( https://user-images.githubusercontent.com/49353917/210941979-6db8b55c-2881-41d8-9e2e-6263b1dece13.jpg )
257257
258258### git merge
259- Usage: ` git-sim merge <branch> `
259+ Usage: ` git-sim merge <branch> [-m "Commit message"] [--no-ff] `
260260
261261- Specify ` <branch> ` as the branch name to merge into the active branch
262+ - If desired, specify a commit message with the ` -m ` option
262263- Simulated output will depict a fast-forward merge if possible
263264- Otherwise, a three-way merge will be depicted
264265- To force a merge commit when a fast-forward is possible, use ` --no-ff `
266+ - If merge fails due to merge conflicts, the conflicting files are displayed
265267
266268![ git-sim-merge_01-05-23_09-44-46] ( https://user-images.githubusercontent.com/49353917/210942030-c7229488-571a-4943-a1f4-c6e4a0c8ccf3.jpg )
267269
Original file line number Diff line number Diff line change @@ -153,10 +153,16 @@ def merge(
153153 "--no-ff" ,
154154 help = "Simulate creation of a merge commit in all cases, even when the merge could instead be resolved as a fast-forward" ,
155155 ),
156+ message : str = typer .Option (
157+ "Merge commit" ,
158+ "--message" ,
159+ "-m" ,
160+ help = "The commit message of the new merge commit" ,
161+ ),
156162):
157163 from git_sim .merge import Merge
158164
159- scene = Merge (branch = branch , no_ff = no_ff )
165+ scene = Merge (branch = branch , no_ff = no_ff , message = message )
160166 handle_animations (scene = scene )
161167
162168
Original file line number Diff line number Diff line change 1313
1414
1515class Merge (GitSimBaseCommand ):
16- def __init__ (self , branch : str , no_ff : bool ):
16+ def __init__ (self , branch : str , no_ff : bool , message : str ):
1717 super ().__init__ ()
1818 self .branch = branch
1919 self .no_ff = no_ff
20+ self .message = message
2021
2122 try :
2223 git .repo .fun .rev_parse (self .repo , self .branch )
@@ -76,7 +77,7 @@ def construct(self):
7677
7778 if self .no_ff :
7879 self .center_frame_on_commit (branch_commit )
79- commitId = self .setup_and_draw_parent (branch_commit , "Merge commit" )
80+ commitId = self .setup_and_draw_parent (branch_commit , self . message )
8081
8182 # If pre-merge HEAD is on screen, drawn an arrow to it as 2nd parent
8283 if head_commit .hexsha in self .drawnCommits :
@@ -129,7 +130,7 @@ def construct(self):
129130 self .center_frame_on_commit (head_commit )
130131 self .setup_and_draw_parent (
131132 head_commit ,
132- "Merge commit" ,
133+ self . message ,
133134 shift = 2 * m .DOWN ,
134135 draw_arrow = False ,
135136 color = m .GRAY ,
You can’t perform that action at this time.
0 commit comments