Commit d12e6b2
wt-status: suggest 'git rebase --continue' to conclude 'merge' instruction
Since 982288e (status: rebase and merge can be in progress at the
same time, 2018-11-12), when a merge is in progress as part of a 'git
rebase -r' operation, 'wt_longstatus_print_state' shows information
about the in-progress rebase (via show_rebase_information), and then
calls 'show_merge_in_progress' to help the user conclude the merge. This
function suggests using 'git commit' to do so, but this throws away the
authorship information from the original merge, which is not ideal.
Using 'git rebase --continue' instead preserves the authorship
information, since we enter 'sequencer.c:run_git_commit' which calls
read_env_script to read the author-script file.
Note however that this only works when a merge was scheduled using a
'merge' instruction in the rebase todo list. Indeed, when using 'exec
git merge', the state files necessary for 'git rebase --continue' are
not present, and one must use 'git commit' (or 'git merge --continue')
in that case.
Be more helpful to the user by suggesting either 'git rebase
--continue', when the merge was scheduled using a 'merge' instruction,
and 'git commit' otherwise. As such, add a
'merge_during_rebase_in_progress' field to 'struct wt_status_state', and
detect this situation in wt_status_check_rebase by looking at the last
command done. Adjust wt_longstatus_print_state to check this field and
suggest 'git rebase --continue' if a merge came from a 'merge'
instruction, by calling show_rebase_in_progress directly.
Add two tests for the new behaviour, using 'merge' and 'exec git merge'
instructions.
Signed-off-by: Philippe Blain <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent 4df4aed commit d12e6b2
3 files changed
+90
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
186 | 261 | | |
187 | 262 | | |
188 | 263 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1744 | 1744 | | |
1745 | 1745 | | |
1746 | 1746 | | |
| 1747 | + | |
1747 | 1748 | | |
1748 | 1749 | | |
1749 | 1750 | | |
| |||
1760 | 1761 | | |
1761 | 1762 | | |
1762 | 1763 | | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
1763 | 1767 | | |
1764 | 1768 | | |
| 1769 | + | |
1765 | 1770 | | |
1766 | 1771 | | |
1767 | 1772 | | |
| |||
1855 | 1860 | | |
1856 | 1861 | | |
1857 | 1862 | | |
1858 | | - | |
1859 | | - | |
1860 | | - | |
1861 | | - | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
1862 | 1872 | | |
1863 | 1873 | | |
1864 | 1874 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| |||
0 commit comments