1
- @wip
2
- Feature : Commit staged changes to the Repository
3
- As a PowerShell user
4
- I want to save the changes I made in my repository
5
- So that I can restore a previous state of my work whenever I need to
6
-
7
- Scenario : Save-Change should have similar paramteres as git commit
8
- Given we have a command Save-Change
9
- Then it should have parameters:
10
- | Name | Type |
11
- | Message | String [] |
12
- | CopyAuthorshipAndMessageFromChange | String |
13
- | CopyAuthorshipAndEditMessageFromChange | String |
14
- | MessageTemplate | String |
15
- | Author | String |
16
- | ModifyLastSavedChange | Switch |
17
- | EditMessage | Switch |
18
- | KeepMessage | Switch |
19
-
20
- # -Message maps to -m/--message
21
- # -CopyAuthorshipAndMessageFromChange maps to -C/--reuse-message
22
- # -CopyAuthorshipAndEditMessageFromChange maps to -c/reedit-message
23
- # -MessageTemplate maps to -t/--template
24
- # -Author maps to --author
25
- # -EditMessage maps to -e/--edit
26
- # -KeepMessage maps to --no-edit
27
- # ignoring pathspecs, --all, --patch, --fixup, --squash, --reset-author,
28
- # --signoff, --no-verify, --allow-empty, --allow-empty-message,
29
- # --no-post-rewrite, --include, --gpg-sign, --no-gpg-sign, -F/--file for the time being
30
- # pathspec will not be provided with PSGit. Any selection of what to commit should be done using Add-Change instead
31
-
32
- @wip
33
- Scenario : Commit all staged changes
34
- Given we have a repository with
35
- | ChangeState | FileName |
36
- | staged | stagedFile .txt |
37
- | staged | other /stagedFile .txt |
38
- | modified | modifiedFile .txt |
39
- When I call Save-Change -Message "Saving all staged changes"
40
- Then the output shows a summary line for the saved change
41
- And the summary line contains the branch name,
42
- And the summary line contains the short commit id
43
- And the summary line contains the commit message
44
- And the status info shows
45
- | ChangeState | FileName |
46
- | modified | modifiedFile .txt |
47
-
48
- @wip
49
- Scenario : Commit with a multipart message
50
- Given we have a repository with
51
- | ChangeState | FileName |
52
- | staged | stagedFile .txt |
53
- | staged | other /stagedFile .txt |
54
- | modified | modifiedFile .txt |
55
- When I call Save-Change -Message "Saving all staged changes" "with additional message text"
56
- Then the output shows a summary line for the saved change
57
- And the summary line contains the branch name,
58
- And the summary line contains the short commit id
59
- And the summary line contains the commit message
60
- And the status info shows
61
- | ChangeState | FileName |
62
- | modified | modifiedFile .txt |
63
- And the status info shows both parts of the commit message as individual paragraphs
64
-
65
- @wip
66
- Scenario : Use an editor to enter a commit message
67
- Given we have a repository with
68
- | ChangeState | FileName |
69
- | staged | stagedFile .txt |
70
- | staged | other /stagedFile .txt |
71
- | modified | modifiedFile .txt |
72
- And I have configured notepad as my default editor for git
73
- When I call Save-Change
74
- Then notepad is opened for entering a commit message
75
-
76
- @wip
77
- Scenario : Use a template for generating a commit message
78
- Given we have a repository with
79
- | ChangeState | FileName |
80
- | staged | stagedFile .txt |
81
- | staged | other /stagedFile .txt |
82
- | modified | modifiedFile .txt |
83
- And I have configured notepad as my default editor for git
84
- And I have configured a template.commitmsg as message template
85
- When I call Save-Change -MessageTemplate
86
- Then notepad is opened for entering a commit message
87
- And the content of template.commitmsg is displayed
88
-
89
- @wip
90
- Scenario : supply author information for saving the change
91
- Given we have a repository with
92
- | ChangeState | FileName |
93
- | staged | stagedFile .txt |
94
- | staged | other /stagedFile .txt |
95
- | modified | modifiedFile .txt |
96
- When I call Save-Change -Message "using different author info" -Author "A U Thor <author@example.com>"
97
- Then the output shows a summary line for the saved change
98
- And the summary line contains the branch name
99
- And the summary line contains the short commit id
100
- And the summary line contains the commit message
101
- And the summary line shows A U Thor as the author of the saved change
102
- And the status info shows
103
- | ChangeState | FileName |
104
- | modified | modifiedFile .txt |
105
-
106
- @wip
107
- Scenario : use the commit message from a previous commit
108
- Given we have a repository with
109
- | Commit | Message | Author |
110
- | First | Initial Commit | John Doe <J .Doe @unknown .com > |
111
- | Second | Grandparent commit message | A U Thor <author @example .com > |
112
- | Third | Parent commit message | Jane Doe <JaneD @unkown .com > |
113
- When I call Save-Change -CopyAuthorshipAndMessageFromChange HEAD~2
114
- Then the output shows a summary line for the saved change
115
- And the summary line contains the branch name
116
- And the summary line contains the short commit id
117
- And the summary line contains the commit message of the Second commit
118
- And the summary line shows A U Thor as the author of the saved change
119
-
120
- @wip
121
- Scenario : use and edit the commit message from a previous commit
122
- Given we have a repository with
123
- | Commit | Message | Author |
124
- | First | Initial Commit | John Doe <J .Doe @unknown .com > |
125
- | Second | Grandparent commit message | A U Thor <author @example .com > |
126
- | Third | Parent commit message | Jane Doe <JaneD @unkown .com > |
127
- And I have configured notepad as my default editor for git
128
- When I call Save-Change -CopyAuthorshipAndEditMessageFromChange HEAD~2
129
- Then notepad is opened for entering a commit message
130
- And the commit message from the Second commit is displayed for editing
131
-
132
- @wip
133
- Scenario : amend the the previous commit and keep the message as it is
134
- Given we have a repository with
135
- | Commit | Message | Author |
136
- | First | Initial Commit | John Doe <J .Doe @unknown .com > |
137
- | Second | Grandparent commit message | A U Thor <author @example .com > |
138
- | Third | Parent commit message | Jane Doe <JaneD @unkown .com > |
139
- When I call Save-Change -ModifyLastSavedChange -KeepMessage
140
- Then the output shows a summary line for the saved change
141
- And the summary line contains the branch name
142
- And the summary line contains the short commit id
143
- And the summary line contains the commit message of the Third commit
144
-
145
- @wip
146
- Scenario : amend the the previous commit and edit the message
147
- Given we have a repository with
148
- | Commit | Message | Author |
149
- | First | Initial Commit | John Doe <J .Doe @unknown .com > |
150
- | Second | Grandparent commit message | A U Thor <author @example .com > |
151
- | Third | Parent commit message | Jane Doe <JaneD @unkown .com > |
152
- And I have configured notepad as my default editor for git
153
- When I call Save-Change -ModifyLastSavedChange -EditMessage
154
- Then notepad is opened for entering a commit message
1
+ @wip
2
+ Feature : Commit staged changes to the Repository
3
+ As a PowerShell user
4
+ I want to save the changes I made in my repository
5
+ So that I can restore a previous state of my work whenever I need to
6
+
7
+ Scenario : Save-Change should have similar paramteres as git commit
8
+ Given we have a command Save-Change
9
+ Then it should have parameters:
10
+ | Name | Type |
11
+ | Message | String [] |
12
+ | CopyAuthorshipAndMessageFromChange | String |
13
+ | CopyAuthorshipAndEditMessageFromChange | String |
14
+ | MessageTemplate | String |
15
+ | Author | String |
16
+ | ModifyLastSavedChange | Switch |
17
+ | EditMessage | Switch |
18
+ | KeepMessage | Switch |
19
+
20
+ # -Message maps to -m/--message
21
+ # -CopyAuthorshipAndMessageFromChange maps to -C/--reuse-message
22
+ # -CopyAuthorshipAndEditMessageFromChange maps to -c/reedit-message
23
+ # -MessageTemplate maps to -t/--template
24
+ # -Author maps to --author
25
+ # -EditMessage maps to -e/--edit
26
+ # -KeepMessage maps to --no-edit
27
+ # ignoring pathspecs, --all, --patch, --fixup, --squash, --reset-author,
28
+ # --signoff, --no-verify, --allow-empty, --allow-empty-message,
29
+ # --no-post-rewrite, --include, --gpg-sign, --no-gpg-sign, -F/--file for the time being
30
+ # pathspec will not be provided with PSGit. Any selection of what to commit should be done using Add-Change instead
31
+
32
+ @wip
33
+ Scenario : Commit all staged changes
34
+ Given we have a repository with
35
+ | ChangeState | FileName |
36
+ | staged | stagedFile .txt |
37
+ | staged | other /stagedFile .txt |
38
+ | modified | modifiedFile .txt |
39
+ When I call Save-Change -Message "Saving all staged changes"
40
+ Then the output shows a summary line for the saved change
41
+ And the summary line contains the branch name,
42
+ And the summary line contains the short commit id
43
+ And the summary line contains the commit message
44
+ And the status info shows
45
+ | ChangeState | FileName |
46
+ | modified | modifiedFile .txt |
47
+
48
+ @wip
49
+ Scenario : Commit with a multipart message
50
+ Given we have a repository with
51
+ | ChangeState | FileName |
52
+ | staged | stagedFile .txt |
53
+ | staged | other /stagedFile .txt |
54
+ | modified | modifiedFile .txt |
55
+ When I call Save-Change -Message "Saving all staged changes" "with additional message text"
56
+ Then the output shows a summary line for the saved change
57
+ And the summary line contains the branch name,
58
+ And the summary line contains the short commit id
59
+ And the summary line contains the commit message
60
+ And the status info shows
61
+ | ChangeState | FileName |
62
+ | modified | modifiedFile .txt |
63
+ And the status info shows both parts of the commit message as individual paragraphs
64
+
65
+ @wip
66
+ Scenario : Use an editor to enter a commit message
67
+ Given we have a repository with
68
+ | ChangeState | FileName |
69
+ | staged | stagedFile .txt |
70
+ | staged | other /stagedFile .txt |
71
+ | modified | modifiedFile .txt |
72
+ And I have configured notepad as my default editor for git
73
+ When I call Save-Change
74
+ Then notepad is opened for entering a commit message
75
+
76
+ @wip
77
+ Scenario : Use a template for generating a commit message
78
+ Given we have a repository with
79
+ | ChangeState | FileName |
80
+ | staged | stagedFile .txt |
81
+ | staged | other /stagedFile .txt |
82
+ | modified | modifiedFile .txt |
83
+ And I have configured notepad as my default editor for git
84
+ And I have configured a template.commitmsg as message template
85
+ When I call Save-Change -MessageTemplate
86
+ Then notepad is opened for entering a commit message
87
+ And the content of template.commitmsg is displayed
88
+
89
+ @wip
90
+ Scenario : supply author information for saving the change
91
+ Given we have a repository with
92
+ | ChangeState | FileName |
93
+ | staged | stagedFile .txt |
94
+ | staged | other /stagedFile .txt |
95
+ | modified | modifiedFile .txt |
96
+ When I call Save-Change -Message "using different author info" -Author "A U Thor <author@example.com>"
97
+ Then the output shows a summary line for the saved change
98
+ And the summary line contains the branch name
99
+ And the summary line contains the short commit id
100
+ And the summary line contains the commit message
101
+ And the summary line shows A U Thor as the author of the saved change
102
+ And the status info shows
103
+ | ChangeState | FileName |
104
+ | modified | modifiedFile .txt |
105
+
106
+ @wip
107
+ Scenario : use the commit message from a previous commit
108
+ Given we have a repository with
109
+ | Commit | Message | Author |
110
+ | First | Initial Commit | John Doe <J .Doe @unknown .com > |
111
+ | Second | Grandparent commit message | A U Thor <author @example .com > |
112
+ | Third | Parent commit message | Jane Doe <JaneD @unkown .com > |
113
+ When I call Save-Change -CopyAuthorshipAndMessageFromChange HEAD~2
114
+ Then the output shows a summary line for the saved change
115
+ And the summary line contains the branch name
116
+ And the summary line contains the short commit id
117
+ And the summary line contains the commit message of the Second commit
118
+ And the summary line shows A U Thor as the author of the saved change
119
+
120
+ @wip
121
+ Scenario : use and edit the commit message from a previous commit
122
+ Given we have a repository with
123
+ | Commit | Message | Author |
124
+ | First | Initial Commit | John Doe <J .Doe @unknown .com > |
125
+ | Second | Grandparent commit message | A U Thor <author @example .com > |
126
+ | Third | Parent commit message | Jane Doe <JaneD @unkown .com > |
127
+ And I have configured notepad as my default editor for git
128
+ When I call Save-Change -CopyAuthorshipAndEditMessageFromChange HEAD~2
129
+ Then notepad is opened for entering a commit message
130
+ And the commit message from the Second commit is displayed for editing
131
+
132
+ @wip
133
+ Scenario : amend the the previous commit and keep the message as it is
134
+ Given we have a repository with
135
+ | Commit | Message | Author |
136
+ | First | Initial Commit | John Doe <J .Doe @unknown .com > |
137
+ | Second | Grandparent commit message | A U Thor <author @example .com > |
138
+ | Third | Parent commit message | Jane Doe <JaneD @unkown .com > |
139
+ When I call Save-Change -ModifyLastSavedChange -KeepMessage
140
+ Then the output shows a summary line for the saved change
141
+ And the summary line contains the branch name
142
+ And the summary line contains the short commit id
143
+ And the summary line contains the commit message of the Third commit
144
+
145
+ @wip
146
+ Scenario : amend the the previous commit and edit the message
147
+ Given we have a repository with
148
+ | Commit | Message | Author | <
5F47
/div>
149
+ | First | Initial Commit | John Doe <J .Doe @unknown .com > |
150
+ | Second | Grandparent commit message | A U Thor <author @example .com > |
151
+ | Third | Parent commit message | Jane Doe <JaneD @unkown .com > |
152
+ And I have configured notepad as my default editor for git
153
+ When I call Save-Change -ModifyLastSavedChange -EditMessage
154
+ Then notepad is opened for entering a commit message
155
155
And the commit message from the Second commit is displayed for editing
0 commit comments