Skip to contentSkip to conversation

status: remove the empty line after hints

PATCH Superseded John Lin via GitGitGadget 4 participants 12 messages May 15, 2019 – Jun 4, 2019

lore
Share & tools
lore
#0 lore raw

cover status: remove the empty line after hints

Before this patch, there is inconsistency between the status messages with hints and the ones without hints: there is an empty line between the title and the file list if hints are presented, but there isn't one if there are no hints.

This patch remove the inconsistency by removing the empty lines even if hints are presented.

John Lin (1):
status: remove the empty line after hints

 t/t7060-wtstatus.sh    |  5 ----
 t/t7508-status.sh      | 62 ------------------------------------------
 t/t7512-status-help.sh | 14 ----------
 wt-status.c            |  4 ---
 4 files changed, 85 deletions(-)

base-commit: ab15ad1a3b4b04a29415aef8c9afa2f64fc194a2
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-196%2Fjohnlinp%2Ffix-status-empty-line-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-196/johnlinp/fix-status-empty-line-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/196

Signature · 1 line
gitgitgadget
#1 lore raw

PATCH 1/1 status: remove the empty line after hints

From: John Lin <[email protected]>

Before this patch, there is inconsistency between the status messages with hints and the ones without hints: there is an empty line between the title and the file list if hints are presented, but there isn't one if there are no hints.

This patch remove the inconsistency by removing the empty lines even if hints are presented.

---
 t/t7060-wtstatus.sh    |  5 ----
 t/t7508-status.sh      | 62 ------------------------------------------
 t/t7512-status-help.sh | 14 ----------
 wt-status.c            |  4 ---
 4 files changed, 85 deletions(-)
t/t7060-wtstatus.sh +0 -5
index 53cf42fac1..d5218743e9 100755
@@ -38,7 +38,6 @@ You have unmerged paths.
 
 Unmerged paths:
   (use "git add/rm <file>..." as appropriate to mark resolution)
-
 	deleted by us:   foo
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -143,7 +142,6 @@ You have unmerged paths.
 
 Unmerged paths:
   (use "git add/rm <file>..." as appropriate to mark resolution)
-
 	both added:      conflict.txt
 	deleted by them: main.txt
 
@@ -177,7 +175,6 @@ You have unmerged paths.
 
 Unmerged paths:
   (use "git add/rm <file>..." as appropriate to mark resolution)
-
 	both deleted:    main.txt
 	added by them:   sub_master.txt
 	added by us:     sub_second.txt
@@ -201,12 +198,10 @@ You have unmerged paths.
   (use "git merge --abort" to abort the merge)
 
 Changes to be committed:
-
 	new file:   sub_master.txt
 
 Unmerged paths:
   (use "git rm <file>..." to mark resolution)
-
 	both deleted:    main.txt
 
 Untracked files not listed (use -u option to show untracked files)
t/t7508-status.sh +0 -62

389 lines not on this page · raw message

t/t7512-status-help.sh +0 -14
index c1eb72555d..e5ba2d2c8a 100755
@@ -33,7 +33,6 @@ You have unmerged paths.
 
 Unmerged paths:
   (use "git add <file>..." to mark resolution)
-
 	both modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -54,7 +53,6 @@ All conflicts fixed but you are still merging.
   (use "git commit" to conclude merge)
 
 Changes to be committed:
-
 	modified:   main.txt
 
 Untracked files not listed (use -u option to show untracked files)
@@ -87,7 +85,6 @@ You are currently rebasing branch '\''rebase_conflicts'\'' on '\''$ONTO'\''.
 Unmerged paths:
   (use "git reset HEAD <file>..." to unstage)
   (use "git add <file>..." to mark resolution)
-
 	both modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -111,7 +108,6 @@ You are currently rebasing branch '\''rebase_conflicts'\'' on '\''$ONTO'\''.
 
 Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)
-
 	modified:   main.txt
 
 Untracked files not listed (use -u option to show untracked files)
@@ -150,7 +146,6 @@ You are currently rebasing branch '\''rebase_i_conflicts_second'\'' on '\''$ONTO
 Unmerged paths:
   (use "git reset HEAD <file>..." to unstage)
   (use "git add <file>..." to mark resolution)
-
 	both modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -177,7 +172,6 @@ You are currently rebasing branch '\''rebase_i_conflicts_second'\'' on '\''$ONTO
 
 Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)
-
 	modified:   main.txt
 
 Untracked files not listed (use -u option to show untracked files)
@@ -247,7 +241,6 @@ You are currently splitting a commit while rebasing branch '\''split_commit'\''
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)
-
 	modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -355,7 +348,6 @@ You are currently splitting a commit while rebasing branch '\''several_edits'\''
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)
-
 	modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -454,7 +446,6 @@ You are currently splitting a commit while rebasing branch '\''several_edits'\''
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)
-
 	modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -558,7 +549,6 @@ You are currently splitting a commit while rebasing branch '\''several_edits'\''
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)
-
 	modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -747,7 +737,6 @@ You are currently cherry-picking commit $TO_CHERRY_PICK.
 
 Unmerged paths:
   (use "git add <file>..." to mark resolution)
-
 	both modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -771,7 +760,6 @@ You are currently cherry-picking commit $TO_CHERRY_PICK.
   (use "git cherry-pick --abort" to cancel the cherry-pick operation)
 
 Changes to be committed:
-
 	modified:   main.txt
 
 Untracked files not listed (use -u option to show untracked files)
@@ -836,7 +824,6 @@ You are currently reverting commit $TO_REVERT.
 Unmerged paths:
   (use "git reset HEAD <file>..." to unstage)
   (use "git add <file>..." to mark resolution)
-
 	both modified:   to-revert.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -856,7 +843,6 @@ You are currently reverting commit $TO_REVERT.
 
 Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)
-
 	modified:   to-revert.txt
 
 Untracked files not listed (use -u option to show untracked files)
wt-status.c +0 -4
index e065558c31..3d10d19af0 100644
@@ -194,7 +194,6 @@ static void wt_longstatus_print_unmerged_header(struct wt_status *s)
 	} else {
 		status_printf_ln(s, c, _("  (use \"git add/rm <file>...\" as appropriate to mark resolution)"));
 	}
-	status_printf_ln(s, c, "%s", "");
 }
 
 static void wt_longstatus_print_cached_header(struct wt_status *s)
@@ -210,7 +209,6 @@ static void wt_longstatus_print_cached_header(struct wt_status *s)
 		status_printf_ln(s, c, _("  (use \"git reset %s <file>...\" to unstage)"), s->reference);
 	else
 		status_printf_ln(s, c, _("  (use \"git rm --cached <file>...\" to unstage)"));
-	status_printf_ln(s, c, "%s", "");
 }
 
 static void wt_longstatus_print_dirty_header(struct wt_status *s,
@@ -229,7 +227,6 @@ static void wt_longstatus_print_dirty_header(struct wt_status *s,
 	status_printf_ln(s, c, _("  (use \"git checkout -- <file>...\" to discard changes in working directory)"));
 	if (has_dirty_submodules)
 		status_printf_ln(s, c, _("  (commit or discard the untracked or modified content in submodules)"));
-	status_printf_ln(s, c, "%s", "");
 }
 
 static void wt_longstatus_print_other_header(struct wt_status *s,
@@ -241,7 +238,6 @@ static void wt_longstatus_print_other_header(struct wt_status *s,
 	if (!s->hints)
 		return;
 	status_printf_ln(s, c, _("  (use \"git %s <file>...\" to include in what will be committed)"), how);
-	status_printf_ln(s, c, "%s", "");
 }
 
 static void wt_longstatus_print_trailer(struct wt_status *s)
Signature · 1 line
gitgitgadget
#2 lore raw

Hi Junio,

John Lin via GitGitGadget <[email protected]> 於 2019年5月15日 週三 下午6:54寫道:

Quoted 10 lines

From: John Lin <[email protected]>

Before this patch, there is inconsistency between the status messages with hints and the ones without hints: there is an empty line between the title and the file list if hints are presented, but there isn't one if there are no hints.

This patch remove the inconsistency by removing the empty lines even if hints are presented.

I would like to ask for the final decision on this patch. Thank you.

Best,
John Lin

Quoted 625 lines
---
 t/t7060-wtstatus.sh    |  5 ----
 t/t7508-status.sh      | 62 ------------------------------------------
 t/t7512-status-help.sh | 14 ----------
 wt-status.c            |  4 ---
 4 files changed, 85 deletions(-)
t/t7060-wtstatus.sh +0 -5
index 53cf42fac1..d5218743e9 100755
@@ -38,7 +38,6 @@ You have unmerged paths.
 
 Unmerged paths:
   (use "git add/rm <file>..." as appropriate to mark resolution)
-
        deleted by us:   foo
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -143,7 +142,6 @@ You have unmerged paths.
 
 Unmerged paths:
   (use "git add/rm <file>..." as appropriate to mark resolution)
-
        both added:      conflict.txt
        deleted by them: main.txt
 
@@ -177,7 +175,6 @@ You have unmerged paths.
 
 Unmerged paths:
   (use "git add/rm <file>..." as appropriate to mark resolution)
-
        both deleted:    main.txt
        added by them:   sub_master.txt
        added by us:     sub_second.txt
@@ -201,12 +198,10 @@ You have unmerged paths.
   (use "git merge --abort" to abort the merge)
 
 Changes to be committed:
-
        new file:   sub_master.txt
 
 Unmerged paths:
   (use "git rm <file>..." to mark resolution)
-
        both deleted:    main.txt
 
 Untracked files not listed (use -u option to show untracked files)
t/t7508-status.sh +0 -62
index e1f11293e2..1cb1032c98 100755
@@ -95,18 +95,15 @@ test_expect_success 'status --column' '
 #
 # Changes to be committed:
 #   (use "git reset HEAD <file>..." to unstage)
-#
 #      new file:   dir2/added
 #
 # Changes not staged for commit:
 #   (use "git add <file>..." to update what will be committed)
 #   (use "git checkout -- <file>..." to discard changes in working directory)
-#
 #      modified:   dir1/modified
 #
 # Untracked files:
 #   (use "git add <file>..." to include in what will be committed)
-#
 #      dir1/untracked dir2/untracked
 #      dir2/modified  untracked
 #
@@ -129,18 +126,15 @@ cat >expect <<\EOF
 #
 # Changes to be committed:
 #   (use "git reset HEAD <file>..." to unstage)
-#
 #      new file:   dir2/added
 #
 # Changes not staged for commit:
 #   (use "git add <file>..." to update what will be committed)
 #   (use "git checkout -- <file>..." to discard changes in working directory)
-#
 #      modified:   dir1/modified
 #
 # Untracked files:
 #   (use "git add <file>..." to include in what will be committed)
-#
 #      dir1/untracked
 #      dir2/modified
 #      dir2/untracked
@@ -279,23 +273,19 @@ and have 1 and 2 different commits each, respectively.
 
 Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)
-
        new file:   dir2/added
 
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)
-
        modified:   dir1/modified
 
 Untracked files:
   (use "git add <file>..." to include in what will be committed)
-
        dir2/modified
 
 Ignored files:
   (use "git add -f <file>..." to include in what will be committed)
-
        .gitignore
        dir1/untracked
        dir2/untracked
@@ -348,18 +338,15 @@ and have 1 and 2 different commits each, respectively.
 
 Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)
-
        new file:   dir2/added
 
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)
-
        modified:   dir1/modified
 
 Ignored files:
   (use "git add -f <file>..." to include in what will be committed)
-
        .gitignore
        dir1/untracked
        dir2/modified
@@ -421,13 +408,11 @@ and have 1 and 2 different commits each, respectively.
 
 Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)
-
        new file:   dir2/added
 
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)
-
        modified:   dir1/modified
 
 Untracked files not listed (use -u option to show untracked files)
@@ -485,18 +470,15 @@ and have 1 and 2 different commits each, respectively.
 
 Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)
-
        new file:   dir2/added
 
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)
-
        modified:   dir1/modified
 
 Untracked files:
   (use "git add <file>..." to include in what will be committed)
-
        dir1/untracked
        dir2/modified
        dir2/untracked
@@ -543,18 +525,15 @@ and have 1 and 2 different commits each, respectively.
 
 Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)
-
        new file:   dir2/added
 
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)
-
        modified:   dir1/modified
 
 Untracked files:
   (use "git add <file>..." to include in what will be committed)
-
        dir1/untracked
        dir2/modified
        dir2/untracked
@@ -606,18 +585,15 @@ and have 1 and 2 different commits each, respectively.
 
 Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)
-
        new file:   ../dir2/added
 
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)
-
        modified:   modified
 
 Untracked files:
   (use "git add <file>..." to include in what will be committed)
-
        untracked
        ../dir2/modified
        ../dir2/untracked
@@ -677,18 +653,15 @@ and have 1 and 2 different commits each, respectively.
 
 Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)
-
        <GREEN>new file:   dir2/added<RESET>
 
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)
-
        <RED>modified:   dir1/modified<RESET>
 
 Untracked files:
   (use "git add <file>..." to include in what will be committed)
-
        <BLUE>dir1/untracked<RESET>
        <BLUE>dir2/modified<RESET>
        <BLUE>dir2/untracked<RESET>
@@ -803,18 +776,15 @@ and have 1 and 2 different commits each, respectively.
 
 Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)
-
        new file:   dir2/added
 
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)
-
        modified:   dir1/modified
 
 Untracked files:
   (use "git add <file>..." to include in what will be committed)
-
        dir1/untracked
        dir2/modified
        dir2/untracked
@@ -853,12 +823,10 @@ and have 1 and 2 different commits each, respectively.
 
 Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)
-
        modified:   dir1/modified
 
 Untracked files:
   (use "git add <file>..." to include in what will be committed)
-
        dir1/untracked
        dir2/
        untracked
@@ -897,19 +865,16 @@ and have 1 and 2 different commits each, respectively.
 
 Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)
-
        new file:   dir2/added
        new file:   sm
 
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)
-
        modified:   dir1/modified
 
 Untracked files:
   (use "git add <file>..." to include in what will be committed)
-
        dir1/untracked
        dir2/modified
        dir2/untracked
@@ -957,14 +922,12 @@ and have 1 and 2 different commits each, respectively.
 
 Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)
-
        new file:   dir2/added
        new file:   sm
 
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)
-
        modified:   dir1/modified
 
 Submodule changes to be committed:
@@ -974,7 +937,6 @@ Submodule changes to be committed:
 
 Untracked files:
   (use "git add <file>..." to include in what will be committed)
-
        dir1/untracked
        dir2/modified
        dir2/untracked
@@ -1020,12 +982,10 @@ and have 2 and 2 different commits each, respectively.
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)
-
        modified:   dir1/modified
 
 Untracked files:
   (use "git add <file>..." to include in what will be committed)
-
        dir1/untracked
        dir2/modified
        dir2/untracked
@@ -1069,14 +1029,12 @@ and have 2 and 2 different commits each, respectively.
 
 Changes to be committed:
   (use "git reset HEAD^1 <file>..." to unstage)
-
        new file:   dir2/added
        new file:   sm
 
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)
-
        modified:   dir1/modified
 
 Submodule changes to be committed:
@@ -1086,7 +1044,6 @@ Submodule changes to be committed:
 
 Untracked files:
   (use "git add <file>..." to include in what will be committed)
-
        dir1/untracked
        dir2/modified
        dir2/untracked
@@ -1124,13 +1081,11 @@ and have 2 and 2 different commits each, respectively.
 
 Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)
-
        modified:   sm
 
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)
-
        modified:   dir1/modified
 
 Submodule changes to be committed:
@@ -1140,7 +1095,6 @@ Submodule changes to be committed:
 
 Untracked files:
   (use "git add <file>..." to include in what will be committed)
-
        .gitmodules
        dir1/untracked
        dir2/modified
@@ -1236,14 +1190,12 @@ and have 2 and 2 different commits each, respectively.
 
 Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)
-
        modified:   sm
 
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)
   (commit or discard the untracked or modified content in submodules)
-
        modified:   dir1/modified
        modified:   sm (modified content)
 
@@ -1254,7 +1206,6 @@ Submodule changes to be committed:
 
 Untracked files:
   (use "git add <file>..." to include in what will be committed)
-
        .gitmodules
        dir1/untracked
        dir2/modified
@@ -1296,13 +1247,11 @@ and have 2 and 2 different commits each, respectively.
 
 Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)
-
        modified:   sm
 
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)
-
        modified:   dir1/modified
        modified:   sm (new commits)
 
@@ -1318,7 +1267,6 @@ Submodules changed but not updated:
 
 Untracked files:
   (use "git add <file>..." to include in what will be committed)
-
        .gitmodules
        dir1/untracked
        dir2/modified
@@ -1380,13 +1328,11 @@ cat > expect << EOF
 ;
 ; Changes to be committed:
 ;   (use "git reset HEAD <file>..." to unstage)
-;
 ;      modified:   sm
 ;
 ; Changes not staged for commit:
 ;   (use "git add <file>..." to update what will be committed)
 ;   (use "git checkout -- <file>..." to discard changes in working directory)
-;
 ;      modified:   dir1/modified
 ;      modified:   sm (new commits)
 ;
@@ -1402,7 +1348,6 @@ cat > expect << EOF
 ;
 ; Untracked files:
 ;   (use "git add <file>..." to include in what will be committed)
-;
 ;      .gitmodules
 ;      dir1/untracked
 ;      dir2/modified
@@ -1432,12 +1377,10 @@ and have 2 and 2 different commits each, respectively.
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)
-
        modified:   dir1/modified
 
 Untracked files:
   (use "git add <file>..." to include in what will be committed)
-
        .gitmodules
        dir1/untracked
        dir2/modified
@@ -1459,18 +1402,15 @@ and have 2 and 2 different commits each, respectively.
 
 Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)
-
        modified:   sm
 
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)
-
        modified:   dir1/modified
 
 Untracked files:
   (use "git add <file>..." to include in what will be committed)
-
        .gitmodules
        dir1/untracked
        dir2/modified
@@ -1582,13 +1522,11 @@ and have 2 and 2 different commits each, respectively.
 
 Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)
-
        modified:   sm
 
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)
-
        modified:   dir1/modified
 
 Untracked files not listed (use -u option to show untracked files)
t/t7512-status-help.sh +0 -14
index c1eb72555d..e5ba2d2c8a 100755
@@ -33,7 +33,6 @@ You have unmerged paths.
 
 Unmerged paths:
   (use "git add <file>..." to mark resolution)
-
        both modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -54,7 +53,6 @@ All conflicts fixed but you are still merging.
   (use "git commit" to conclude merge)
 
 Changes to be committed:
-
        modified:   main.txt
 
 Untracked files not listed (use -u option to show untracked files)
@@ -87,7 +85,6 @@ You are currently rebasing branch '\''rebase_conflicts'\'' on '\''$ONTO'\''.
 Unmerged paths:
   (use "git reset HEAD <file>..." to unstage)
   (use "git add <file>..." to mark resolution)
-
        both modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -111,7 +108,6 @@ You are currently rebasing branch '\''rebase_conflicts'\'' on '\''$ONTO'\''.
 
 Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)
-
        modified:   main.txt
 
 Untracked files not listed (use -u option to show untracked files)
@@ -150,7 +146,6 @@ You are currently rebasing branch '\''rebase_i_conflicts_second'\'' on '\''$ONTO
 Unmerged paths:
   (use "git reset HEAD <file>..." to unstage)
   (use "git add <file>..." to mark resolution)
-
        both modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -177,7 +172,6 @@ You are currently rebasing branch '\''rebase_i_conflicts_second'\'' on '\''$ONTO
 
 Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)
-
        modified:   main.txt
 
 Untracked files not listed (use -u option to show untracked files)
@@ -247,7 +241,6 @@ You are currently splitting a commit while rebasing branch '\''split_commit'\''
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)
-
        modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -355,7 +348,6 @@ You are currently splitting a commit while rebasing branch '\''several_edits'\''
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)
-
        modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -454,7 +446,6 @@ You are currently splitting a commit while rebasing branch '\''several_edits'\''
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)
-
        modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -558,7 +549,6 @@ You are currently splitting a commit while rebasing branch '\''several_edits'\''
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git checkout -- <file>..." to discard changes in working directory)
-
        modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -747,7 +737,6 @@ You are currently cherry-picking commit $TO_CHERRY_PICK.
 
 Unmerged paths:
   (use "git add <file>..." to mark resolution)
-
        both modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -771,7 +760,6 @@ You are currently cherry-picking commit $TO_CHERRY_PICK.
   (use "git cherry-pick --abort" to cancel the cherry-pick operation)
 
 Changes to be committed:
-
        modified:   main.txt
 
 Untracked files not listed (use -u option to show untracked files)
@@ -836,7 +824,6 @@ You are currently reverting commit $TO_REVERT.
 Unmerged paths:
   (use "git reset HEAD <file>..." to unstage)
   (use "git add <file>..." to mark resolution)
-
        both modified:   to-revert.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -856,7 +843,6 @@ You are currently reverting commit $TO_REVERT.
 
 Changes to be committed:
   (use "git reset HEAD <file>..." to unstage)
-
        modified:   to-revert.txt
 
 Untracked files not listed (use -u option to show untracked files)
wt-status.c +0 -5
index e065558c31..3d10d19af0 100644
@@ -194,7 +194,6 @@ static void wt_longstatus_print_unmerged_header(struct wt_status *s)
        } else {
                status_printf_ln(s, c, _("  (use \"git add/rm <file>...\" as appropriate to mark resolution)"));
        }
-       status_printf_ln(s, c, "%s", "");
 }
 
 static void wt_longstatus_print_cached_header(struct wt_status *s)
@@ -210,7 +209,6 @@ static void wt_longstatus_print_cached_header(struct wt_status *s)
                status_printf_ln(s, c, _("  (use \"git reset %s <file>...\" to unstage)"), s->reference);
        else
                status_printf_ln(s, c, _("  (use \"git rm --cached <file>...\" to unstage)"));
-       status_printf_ln(s, c, "%s", "");
 }
 
 static void wt_longstatus_print_dirty_header(struct wt_status *s,
@@ -229,7 +227,6 @@ static void wt_longstatus_print_dirty_header(struct wt_status *s,
        status_printf_ln(s, c, _("  (use \"git checkout -- <file>...\" to discard changes in working directory)"));
        if (has_dirty_submodules)
                status_printf_ln(s, c, _("  (commit or discard the untracked or modified content in submodules)"));
-       status_printf_ln(s, c, "%s", "");
 }
 
 static void wt_longstatus_print_other_header(struct wt_status *s,
@@ -241,7 +238,6 @@ static void wt_longstatus_print_other_header(struct wt_status *s,
        if (!s->hints)
                return;
        status_printf_ln(s, c, _("  (use \"git %s <file>...\" to include in what will be committed)"), how);
-       status_printf_ln(s, c, "%s", "");
 }
 
 static void wt_longstatus_print_trailer(struct wt_status *s)
--

gitgitgadget

#3 lore raw
Quoted 11 lines · 林自均

Hi Junio,

John Lin via GitGitGadget <[email protected]> 於 2019年5月15日 週三 下午6:54寫道:

Quoted 8 lines

From: John Lin <[email protected]>

Before this patch, there is inconsistency between the status messages with hints and the ones without hints: there is an empty line between the title and the file list if hints are presented, but there isn't one if there are no hints.

Quoted 4 lines
Quoted 2 lines

This patch remove the inconsistency by removing the empty lines even if hints are presented.

I would like to ask for the final decision on this patch. Thank you.

If I recall correctly, the test part of this patch conflicts badly with a topic in flight that splits 'checkout' into 'restore' and 'switch', which is a more important topic between the two. So if I must give _the final_ decision, then we need to drop this patch, but I'd rather not ;-)

Doing this change on top of the switch/restore topic, once it stabilized more and graduated to 'master', would be the best course of action, I would think.

Thanks.

#4 lore raw

Hi Junio,

Junio C Hamano <[email protected]> 於 2019年5月29日 週三 上午4:41寫道:

Quoted 25 lines
Quoted 11 lines · 林自均

Hi Junio,

John Lin via GitGitGadget <[email protected]> 於 2019年5月15日 週三 下午6:54寫道:

Quoted 8 lines

From: John Lin <[email protected]>

Before this patch, there is inconsistency between the status messages with hints and the ones without hints: there is an empty line between the title and the file list if hints are presented, but there isn't one if there are no hints.

Quoted 4 lines
Quoted 2 lines

This patch remove the inconsistency by removing the empty lines even if hints are presented.

I would like to ask for the final decision on this patch. Thank you.

If I recall correctly, the test part of this patch conflicts badly with a topic in flight that splits 'checkout' into 'restore' and 'switch', which is a more important topic between the two. So if I must give _the final_ decision, then we need to drop this patch, but I'd rather not ;-)

Quoted 5 lines

Doing this change on top of the switch/restore topic, once it stabilized more and graduated to 'master', would be the best course of action, I would think.

Thanks.

I see. Thanks for your kind explanation. I'll wait for the switch/restore topic to merge into master.

Best,
John Lin

#5 lore raw

Hi John Lin,

Quoted 24 lines · 林自均

Junio C Hamano <[email protected]> 於 2019年5月29日 週三 上午4:41寫道:

Quoted 23 lines
Quoted 9 lines · 林自均

John Lin via GitGitGadget <[email protected]> 於 2019年5月15日 週三 下午6:54寫道:

Quoted 8 lines

From: John Lin <[email protected]>

Before this patch, there is inconsistency between the status messages with hints and the ones without hints: there is an empty line between the title and the file list if hints are presented, but there isn't one if there are no hints.

Quoted 4 lines
Quoted 2 lines

This patch remove the inconsistency by removing the empty lines even if hints are presented.

I would like to ask for the final decision on this patch. Thank you.

If I recall correctly, the test part of this patch conflicts badly with a topic in flight that splits 'checkout' into 'restore' and 'switch', which is a more important topic between the two. So if I must give _the final_ decision, then we need to drop this patch, but I'd rather not ;-)

Quoted 8 lines
Quoted 5 lines

Doing this change on top of the switch/restore topic, once it stabilized more and graduated to 'master', would be the best course of action, I would think.

Thanks.

I see. Thanks for your kind explanation. I'll wait for the switch/restore topic to merge into master.

You could already rebase it on top of
https://github.com/gitgitgadget/git/tree/nd/switch-and-restore, say so in your cover letter, and send a new iteration.

Ciao,
Johannes

#6 lore raw

Hi Johannes,

Johannes Schindelin <[email protected]> 於 2019年5月29日 週三 下午7:51寫道:

Quoted 6 lines

Hi John Lin,

You could already rebase it on top of
https://github.com/gitgitgadget/git/tree/nd/switch-and-restore, say so in your cover letter, and send a new iteration.

Thanks for the suggestion. I already rebase on your nd/switch-and-restore: https://github.com/gitgitgadget/git/pull/196
However, it seems to have some conflict with the master branch and gitgitgadget refused to submit the patch. So I guess I still have to wait for the nd/switch-and-restore to resolve the conflict.

Best,
John Lin

#7 lore raw

Hi John Lin,

Quoted 7 lines · 林自均

Johannes Schindelin <[email protected]> 於 2019年5月29日 週三 下午7:51寫道:

Quoted 4 lines

You could already rebase it on top of
https://github.com/gitgitgadget/git/tree/nd/switch-and-restore, say so in your cover letter, and send a new iteration.

Quoted 5 lines

Thanks for the suggestion. I already rebase on your nd/switch-and-restore: https://github.com/gitgitgadget/git/pull/196
However, it seems to have some conflict with the master branch and gitgitgadget refused to submit the patch. So I guess I still have to wait for the nd/switch-and-restore to resolve the conflict.

I am so sorry for being so sloppy. I should have said explicitly what I had in mind: target the nd/switch-and-restore branch.

The GitGitGadget fork mirrors not only maint, master, next and pu, but also the individual branches that Junio merges into pu (which are published at https://github.com/gitster/git). That is, you can click the Edit button next to your PR description, and instead of editing the PR description, choose a different target branch from the drop-down box below it.

Since it was totally my mistake for not telling you this explicitly, I allowed myself to do exactly this for you. The Azure Pipeline is running as we speak.

Thanks & my apologies,
Johannes

#8 lore raw

Hi Johannes,

Thank you for your kind and detailed explanation. I really appreciate that. By the way, I just saw it passed all the Azure Pipeline checks. Please consider merging it into nd/switch-and-restore. Thank you.

Best,
John Lin

Johannes Schindelin <[email protected]> 於 2019年6月3日 週一 下午10:17寫道:

Quoted 34 lines

Hi John Lin,

Quoted 7 lines · 林自均

Johannes Schindelin <[email protected]> 於 2019年5月29日 週三 下午7:51寫道:

Quoted 4 lines

You could already rebase it on top of
https://github.com/gitgitgadget/git/tree/nd/switch-and-restore, say so in your cover letter, and send a new iteration.

Quoted 5 lines

Thanks for the suggestion. I already rebase on your nd/switch-and-restore: https://github.com/gitgitgadget/git/pull/196
However, it seems to have some conflict with the master branch and gitgitgadget refused to submit the patch. So I guess I still have to wait for the nd/switch-and-restore to resolve the conflict.

I am so sorry for being so sloppy. I should have said explicitly what I had in mind: target the nd/switch-and-restore branch.

The GitGitGadget fork mirrors not only maint, master, next and pu, but also the individual branches that Junio merges into pu (which are published at https://github.com/gitster/git). That is, you can click the Edit button next to your PR description, and instead of editing the PR description, choose a different target branch from the drop-down box below it.

Since it was totally my mistake for not telling you this explicitly, I allowed myself to do exactly this for you. The Azure Pipeline is running as we speak.

Thanks & my apologies,
Johannes

#9 lore raw

Hi John Lin,

Quoted 3 lines · 林自均

Thank you for your kind and detailed explanation. I really appreciate that. By the way, I just saw it passed all the Azure Pipeline checks. Please consider merging it into nd/switch-and-restore. Thank you.

Could you issue a new /submit, now that everything is clear? That should send a new iteration of your patch to the mailing list for review.

Thanks,
Johannes

Quoted 36 lines

Johannes Schindelin <[email protected]> 於 2019年6月3日 週一 下午10:17寫道:

Quoted 34 lines

Hi John Lin,

Quoted 7 lines · 林自均

Johannes Schindelin <[email protected]> 於 2019年5月29日 週三 下午7:51寫道:

Quoted 4 lines

You could already rebase it on top of
https://github.com/gitgitgadget/git/tree/nd/switch-and-restore, say so in your cover letter, and send a new iteration.

Quoted 5 lines

Thanks for the suggestion. I already rebase on your nd/switch-and-restore: https://github.com/gitgitgadget/git/pull/196
However, it seems to have some conflict with the master branch and gitgitgadget refused to submit the patch. So I guess I still have to wait for the nd/switch-and-restore to resolve the conflict.

I am so sorry for being so sloppy. I should have said explicitly what I had in mind: target the nd/switch-and-restore branch.

The GitGitGadget fork mirrors not only maint, master, next and pu, but also the individual branches that Junio merges into pu (which are published at https://github.com/gitster/git). That is, you can click the Edit button next to your PR description, and instead of editing the PR description, choose a different target branch from the drop-down box below it.

Since it was totally my mistake for not telling you this explicitly, I allowed myself to do exactly this for you. The Azure Pipeline is running as we speak.

Thanks & my apologies,
Johannes

#10 lore raw

v2 cover status: remove the empty line after hints

In reply to John Lin via GitGitGadget

Before this patch, there is inconsistency between the status messages with hints and the ones without hints: there is an empty line between the title and the file list if hints are presented, but there isn't one if there are no hints.

This patch remove the inconsistency by removing the empty lines even if hints are presented.

John Lin (1):
status: remove the empty line after hints

 t/t7060-wtstatus.sh    |  5 ----
 t/t7508-status.sh      | 62 ------------------------------------------
 t/t7512-status-help.sh | 14 ----------
 wt-status.c            |  4 ---
 4 files changed, 85 deletions(-)

base-commit: 4e43b7ff1ea4b6f16b93a432b6718e9ab38749bd
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-196%2Fjohnlinp%2Ffix-status-empty-line-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-196/johnlinp/fix-status-empty-line-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/196

Range-diff vs v1:

1: 468be8f854 ! 1: 7dfb9a4b1a status: remove the empty line after hints
@@ -59,13 +59,13 @@
@@
#
# Changes to be committed:
- # (use "git reset HEAD <file>..." to unstage)
+ # (use "git restore --staged <file>..." to unstage)
-#
# new file: dir2/added
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
- # (use "git checkout -- <file>..." to discard changes in working directory)
+ # (use "git restore <file>..." to discard changes in working directory)
-#
# modified: dir1/modified
#
@@ -78,13 +78,13 @@
@@
#
# Changes to be committed:
- # (use "git reset HEAD <file>..." to unstage)
+ # (use "git restore --staged <file>..." to unstage)
-#
# new file: dir2/added
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
- # (use "git checkout -- <file>..." to discard changes in working directory)
+ # (use "git restore <file>..." to discard changes in working directory)
-#
# modified: dir1/modified
#
@@ -97,13 +97,13 @@
@@

Changes to be committed:
- (use "git reset HEAD <file>..." to unstage)
+ (use "git restore --staged <file>..." to unstage)
-
new file: dir2/added

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
- (use "git checkout -- <file>..." to discard changes in working directory)
+ (use "git restore <file>..." to discard changes in working directory)
-
modified: dir1/modified

@@ -121,13 +121,13 @@
@@

Changes to be committed:
- (use "git reset HEAD <file>..." to unstage)
+ (use "git restore --staged <file>..." to unstage)
-
new file: dir2/added

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
- (use "git checkout -- <file>..." to discard changes in working directory)
+ (use "git restore <file>..." to discard changes in working directory)
-
modified: dir1/modified

@@ -140,13 +140,13 @@
@@

Changes to be committed:
- (use "git reset HEAD <file>..." to unstage)
+ (use "git restore --staged <file>..." to unstage)
-
new file: dir2/added

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
- (use "git checkout -- <file>..." to discard changes in working directory)
+ (use "git restore <file>..." to discard changes in working directory)
-
modified: dir1/modified

@@ -154,13 +154,13 @@
@@

Changes to be committed:
- (use "git reset HEAD <file>..." to unstage)
+ (use "git restore --staged <file>..." to unstage)
-
new file: dir2/added

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
- (use "git checkout -- <file>..." to discard changes in working directory)
+ (use "git restore <file>..." to discard changes in working directory)
-
modified: dir1/modified

@@ -173,13 +173,13 @@
@@

Changes to be committed:
- (use "git reset HEAD <file>..." to unstage)
+ (use "git restore --staged <file>..." to unstage)
-
new file: dir2/added

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
- (use "git checkout -- <file>..." to discard changes in working directory)
+ (use "git restore <file>..." to discard changes in working directory)
-
modified: dir1/modified

@@ -192,13 +192,13 @@
@@

Changes to be committed:
- (use "git reset HEAD <file>..." to unstage)
+ (use "git restore --staged <file>..." to unstage)
-
new file: ../dir2/added

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
- (use "git checkout -- <file>..." to discard changes in working directory)
+ (use "git restore <file>..." to discard changes in working directory)
-
modified: modified

@@ -211,13 +211,13 @@
@@

Changes to be committed:
- (use "git reset HEAD <file>..." to unstage)
+ (use "git restore --staged <file>..." to unstage)
-
<GREEN>new file: dir2/added<RESET>

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
- (use "git checkout -- <file>..." to discard changes in working directory)
+ (use "git restore <file>..." to discard changes in working directory)
-
<RED>modified: dir1/modified<RESET>

@@ -230,13 +230,13 @@
@@

Changes to be committed:
- (use "git reset HEAD <file>..." to unstage)
+ (use "git restore --staged <file>..." to unstage)
-
new file: dir2/added

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
- (use "git checkout -- <file>..." to discard changes in working directory)
+ (use "git restore <file>..." to discard changes in working directory)
-
modified: dir1/modified

@@ -249,7 +249,7 @@
@@

Changes to be committed:
- (use "git reset HEAD <file>..." to unstage)
+ (use "git restore --staged <file>..." to unstage)
-
modified: dir1/modified

@@ -262,14 +262,14 @@
@@

Changes to be committed:
- (use "git reset HEAD <file>..." to unstage)
+ (use "git restore --staged <file>..." to unstage)
-
new file: dir2/added
new file: sm

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
- (use "git checkout -- <file>..." to discard changes in working directory)
+ (use "git restore <file>..." to discard changes in working directory)
-
modified: dir1/modified

@@ -282,14 +282,14 @@
@@

Changes to be committed:
- (use "git reset HEAD <file>..." to unstage)
+ (use "git restore --staged <file>..." to unstage)
-
new file: dir2/added
new file: sm

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
- (use "git checkout -- <file>..." to discard changes in working directory)
+ (use "git restore <file>..." to discard changes in working directory)
-
modified: dir1/modified

@@ -305,7 +305,7 @@
@@
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
- (use "git checkout -- <file>..." to discard changes in working directory)
+ (use "git restore <file>..." to discard changes in working directory)
-
modified: dir1/modified

@@ -318,14 +318,14 @@
@@

Changes to be committed:
- (use "git reset HEAD^1 <file>..." to unstage)
+ (use "git restore --source=HEAD^1 --staged <file>..." to unstage)
-
new file: dir2/added
new file: sm

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
- (use "git checkout -- <file>..." to discard changes in working directory)
+ (use "git restore <file>..." to discard changes in working directory)
-
modified: dir1/modified

@@ -341,13 +341,13 @@
@@

Changes to be committed:
- (use "git reset HEAD <file>..." to unstage)
+ (use "git restore --staged <file>..." to unstage)
-
modified: sm

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
- (use "git checkout -- <file>..." to discard changes in working directory)
+ (use "git restore <file>..." to discard changes in working directory)
-
modified: dir1/modified

@@ -363,13 +363,13 @@
@@

Changes to be committed:
- (use "git reset HEAD <file>..." to unstage)
+ (use "git restore --staged <file>..." to unstage)
-
modified: sm

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
- (use "git checkout -- <file>..." to discard changes in working directory)
+ (use "git restore <file>..." to discard changes in working directory)
(commit or discard the untracked or modified content in submodules)
-
modified: dir1/modified
@@ -386,13 +386,13 @@
@@

Changes to be committed:
- (use "git reset HEAD <file>..." to unstage)
+ (use "git restore --staged <file>..." to unstage)
-
modified: sm

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
- (use "git checkout -- <file>..." to discard changes in working directory)
+ (use "git restore <file>..." to discard changes in working directory)
-
modified: dir1/modified
modified: sm (new commits)
@@ -408,13 +408,13 @@
@@
;
; Changes to be committed:
- ; (use "git reset HEAD <file>..." to unstage)
+ ; (use "git restore --staged <file>..." to unstage)
-;
; modified: sm
;
; Changes not staged for commit:
; (use "git add <file>..." to update what will be committed)
- ; (use "git checkout -- <file>..." to discard changes in working directory)
+ ; (use "git restore <file>..." to discard changes in working directory)
-;
; modified: dir1/modified
; modified: sm (new commits)
@@ -430,7 +430,7 @@
@@
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
- (use "git checkout -- <file>..." to discard changes in working directory)
+ (use "git restore <file>..." to discard changes in working directory)
-
modified: dir1/modified

@@ -443,13 +443,13 @@
@@

Changes to be committed:
- (use "git reset HEAD <file>..." to unstage)
+ (use "git restore --staged <file>..." to unstage)
-
modified: sm

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
- (use "git checkout -- <file>..." to discard changes in working directory)
+ (use "git restore <file>..." to discard changes in working directory)
-
modified: dir1/modified

@@ -462,13 +462,13 @@
@@

Changes to be committed:
- (use "git reset HEAD <file>..." to unstage)
+ (use "git restore --staged <file>..." to unstage)
-
modified: sm

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
- (use "git checkout -- <file>..." to discard changes in working directory)
+ (use "git restore <file>..." to discard changes in working directory)
-
modified: dir1/modified

@@ -495,7 +495,7 @@
Untracked files not listed (use -u option to show untracked files)
@@
Unmerged paths:
- (use "git reset HEAD <file>..." to unstage)
+ (use "git restore --staged <file>..." to unstage)
(use "git add <file>..." to mark resolution)
-
both modified: main.txt
@@ -504,14 +504,14 @@
@@

Changes to be committed:
- (use "git reset HEAD <file>..." to unstage)
+ (use "git restore --staged <file>..." to unstage)
-
modified: main.txt

Untracked files not listed (use -u option to show untracked files)
@@
Unmerged paths:
- (use "git reset HEAD <file>..." to unstage)
+ (use "git restore --staged <file>..." to unstage)
(use "git add <file>..." to mark resolution)
-
both modified: main.txt
@@ -520,7 +520,7 @@
@@

Changes to be committed:
- (use "git reset HEAD <file>..." to unstage)
+ (use "git restore --staged <file>..." to unstage)
-
modified: main.txt

@@ -528,7 +528,7 @@
@@
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
- (use "git checkout -- <file>..." to discard changes in working directory)
+ (use "git restore <file>..." to discard changes in working directory)
-
modified: main.txt

@@ -536,7 +536,7 @@
@@
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
- (use "git checkout -- <file>..." to discard changes in working directory)
+ (use "git restore <file>..." to discard changes in working directory)
-
modified: main.txt

@@ -544,7 +544,7 @@
@@
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
- (use "git checkout -- <file>..." to discard changes in working directory)
+ (use "git restore <file>..." to discard changes in working directory)
-
modified: main.txt

@@ -552,7 +552,7 @@
@@
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
- (use "git checkout -- <file>..." to discard changes in working directory)
+ (use "git restore <file>..." to discard changes in working directory)
-
modified: main.txt

@@ -575,7 +575,7 @@
Untracked files not listed (use -u option to show untracked files)
@@
Unmerged paths:
- (use "git reset HEAD <file>..." to unstage)
+ (use "git restore --staged <file>..." to unstage)
(use "git add <file>..." to mark resolution)
-
both modified: to-revert.txt
@@ -584,7 +584,7 @@
@@

Changes to be committed:
- (use "git reset HEAD <file>..." to unstage)
+ (use "git restore --staged <file>..." to unstage)
-
modified: to-revert.txt

@@ -602,15 +602,15 @@

static void wt_longstatus_print_cached_header(struct wt_status *s)
@@
- status_printf_ln(s, c, _(" (use \"git reset %s <file>...\" to unstage)"), s->reference);
- else
+ s->reference);
+ } else
status_printf_ln(s, c, _(" (use \"git rm --cached <file>...\" to unstage)"));
- status_printf_ln(s, c, "%s", "");
}

static void wt_longstatus_print_dirty_header(struct wt_status *s,
@@
- status_printf_ln(s, c, _(" (use \"git checkout -- <file>...\" to discard changes in working directory)"));
+ status_printf_ln(s, c, _(" (use \"git restore <file>...\" to discard changes in working directory)"));
if (has_dirty_submodules)
status_printf_ln(s, c, _(" (commit or discard the untracked or modified content in submodules)"));
- status_printf_ln(s, c, "%s", "");

Signature · 1 line
gitgitgadget
#11 lore raw

PATCH v2 1/1 status: remove the empty line after hints

From: John Lin <[email protected]>

Before this patch, there is inconsistency between the status messages with hints and the ones without hints: there is an empty line between the title and the file list if hints are presented, but there isn't one if there are no hints.

This patch remove the inconsistency by removing the empty lines even if hints are presented.

---
 t/t7060-wtstatus.sh    |  5 ----
 t/t7508-status.sh      | 62 ------------------------------------------
 t/t7512-status-help.sh | 14 ----------
 wt-status.c            |  4 ---
 4 files changed, 85 deletions(-)
t/t7060-wtstatus.sh +0 -5
index 53cf42fac1..d5218743e9 100755
@@ -38,7 +38,6 @@ You have unmerged paths.
 
 Unmerged paths:
   (use "git add/rm <file>..." as appropriate to mark resolution)
-
 	deleted by us:   foo
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -143,7 +142,6 @@ You have unmerged paths.
 
 Unmerged paths:
   (use "git add/rm <file>..." as appropriate to mark resolution)
-
 	both added:      conflict.txt
 	deleted by them: main.txt
 
@@ -177,7 +175,6 @@ You have unmerged paths.
 
 Unmerged paths:
   (use "git add/rm <file>..." as appropriate to mark resolution)
-
 	both deleted:    main.txt
 	added by them:   sub_master.txt
 	added by us:     sub_second.txt
@@ -201,12 +198,10 @@ You have unmerged paths.
   (use "git merge --abort" to abort the merge)
 
 Changes to be committed:
-
 	new file:   sub_master.txt
 
 Unmerged paths:
   (use "git rm <file>..." to mark resolution)
-
 	both deleted:    main.txt
 
 Untracked files not listed (use -u option to show untracked files)
t/t7508-status.sh +0 -62

389 lines not on this page · raw message

t/t7512-status-help.sh +0 -14
index 1b9712c675..bf0b2c8bdb 100755
@@ -33,7 +33,6 @@ You have unmerged paths.
 
 Unmerged paths:
   (use "git add <file>..." to mark resolution)
-
 	both modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -54,7 +53,6 @@ All conflicts fixed but you are still merging.
   (use "git commit" to conclude merge)
 
 Changes to be committed:
-
 	modified:   main.txt
 
 Untracked files not listed (use -u option to show untracked files)
@@ -87,7 +85,6 @@ You are currently rebasing branch '\''rebase_conflicts'\'' on '\''$ONTO'\''.
 Unmerged paths:
   (use "git restore --staged <file>..." to unstage)
   (use "git add <file>..." to mark resolution)
-
 	both modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -111,7 +108,6 @@ You are currently rebasing branch '\''rebase_conflicts'\'' on '\''$ONTO'\''.
 
 Changes to be committed:
   (use "git restore --staged <file>..." to unstage)
-
 	modified:   main.txt
 
 Untracked files not listed (use -u option to show untracked files)
@@ -150,7 +146,6 @@ You are currently rebasing branch '\''rebase_i_conflicts_second'\'' on '\''$ONTO
 Unmerged paths:
   (use "git restore --staged <file>..." to unstage)
   (use "git add <file>..." to mark resolution)
-
 	both modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -177,7 +172,6 @@ You are currently rebasing branch '\''rebase_i_conflicts_second'\'' on '\''$ONTO
 
 Changes to be committed:
   (use "git restore --staged <file>..." to unstage)
-
 	modified:   main.txt
 
 Untracked files not listed (use -u option to show untracked files)
@@ -247,7 +241,6 @@ You are currently splitting a commit while rebasing branch '\''split_commit'\''
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git restore <file>..." to discard changes in working directory)
-
 	modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -355,7 +348,6 @@ You are currently splitting a commit while rebasing branch '\''several_edits'\''
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git restore <file>..." to discard changes in working directory)
-
 	modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -454,7 +446,6 @@ You are currently splitting a commit while rebasing branch '\''several_edits'\''
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git restore <file>..." to discard changes in working directory)
-
 	modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -558,7 +549,6 @@ You are currently splitting a commit while rebasing branch '\''several_edits'\''
 Changes not staged for commit:
   (use "git add <file>..." to update what will be committed)
   (use "git restore <file>..." to discard changes in working directory)
-
 	modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -747,7 +737,6 @@ You are currently cherry-picking commit $TO_CHERRY_PICK.
 
 Unmerged paths:
   (use "git add <file>..." to mark resolution)
-
 	both modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -771,7 +760,6 @@ You are currently cherry-picking commit $TO_CHERRY_PICK.
   (use "git cherry-pick --abort" to cancel the cherry-pick operation)
 
 Changes to be committed:
-
 	modified:   main.txt
 
 Untracked files not listed (use -u option to show untracked files)
@@ -818,7 +806,6 @@ You are currently reverting commit $TO_REVERT.
 Unmerged paths:
   (use "git restore --staged <file>..." to unstage)
   (use "git add <file>..." to mark resolution)
-
 	both modified:   to-revert.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
@@ -838,7 +825,6 @@ You are currently reverting commit $TO_REVERT.
 
 Changes to be committed:
   (use "git restore --staged <file>..." to unstage)
-
 	modified:   to-revert.txt
 
 Untracked files not listed (use -u option to show untracked files)
wt-status.c +0 -4
index 19fd1add75..ddab6b93be 100644
@@ -199,7 +199,6 @@ static void wt_longstatus_print_unmerged_header(struct wt_status *s)
 	} else {
 		status_printf_ln(s, c, _("  (use \"git add/rm <file>...\" as appropriate to mark resolution)"));
 	}
-	status_printf_ln(s, c, "%s", "");
 }
 
 static void wt_longstatus_print_cached_header(struct wt_status *s)
@@ -221,7 +220,6 @@ static void wt_longstatus_print_cached_header(struct wt_status *s)
 					 s->reference);
 	} else
 		status_printf_ln(s, c, _("  (use \"git rm --cached <file>...\" to unstage)"));
-	status_printf_ln(s, c, "%s", "");
 }
 
 static void wt_longstatus_print_dirty_header(struct wt_status *s,
@@ -240,7 +238,6 @@ static void wt_longstatus_print_dirty_header(struct wt_status *s,
 	status_printf_ln(s, c, _("  (use \"git restore <file>...\" to discard changes in working directory)"));
 	if (has_dirty_submodules)
 		status_printf_ln(s, c, _("  (commit or discard the untracked or modified content in submodules)"));
-	status_printf_ln(s, c, "%s", "");
 }
 
 static void wt_longstatus_print_other_header(struct wt_status *s,
@@ -252,7 +249,6 @@ static void wt_longstatus_print_other_header(struct wt_status *s,
 	if (!s->hints)
 		return;
 	status_printf_ln(s, c, _("  (use \"git %s <file>...\" to include in what will be committed)"), how);
-	status_printf_ln(s, c, "%s", "");
 }
 
 static void wt_longstatus_print_trailer(struct wt_status *s)
Signature · 1 line
gitgitgadget