wt-status: lift the artificual "at least 20 columns" floor
authorJunio C Hamano <gitster@pobox.com>
Wed, 12 Mar 2014 20:43:51 +0000 (13:43 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 12 Mar 2014 21:08:05 +0000 (14:08 -0700)
When we show unmerged paths, we had an artificial 20 columns floor
for the width of labels (e.g. "both deleted:") shown next to the
pathnames. Depending on the locale, this may result in a label that
is too wide when all the label strings are way shorter than 20
columns, or no-op when a label string is longer than 20 columns.

Just drop the artificial floor. The screen real estate is better
utilized this way when all the strings are shorter.

Adjust the tests to this change.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7060-wtstatus.sh
t/t7512-status-help.sh
wt-status.c
index 7d467c034a27f50e8b60b4b0f390f08fdf126e55..741ec085767c9469f8ba15408af37cd558df1559 100755 (executable)
@@ -38,7 +38,7 @@ You have unmerged paths.
 Unmerged paths:
   (use "git add/rm <file>..." as appropriate to mark resolution)
 
 Unmerged paths:
   (use "git add/rm <file>..." as appropriate to mark resolution)
 
-       deleted by us:      foo
+       deleted by us:   foo
 
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
 
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
@@ -142,8 +142,8 @@ You have unmerged paths.
 Unmerged paths:
   (use "git add/rm <file>..." as appropriate to mark resolution)
 
 Unmerged paths:
   (use "git add/rm <file>..." as appropriate to mark resolution)
 
-       both added:         conflict.txt
-       deleted by them:    main.txt
+       both added:      conflict.txt
+       deleted by them: main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
 
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
@@ -175,9 +175,9 @@ You have unmerged paths.
 Unmerged paths:
   (use "git add/rm <file>..." as appropriate to mark resolution)
 
 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
+       both deleted:    main.txt
+       added by them:   sub_master.txt
+       added by us:     sub_second.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
 
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
@@ -203,7 +203,7 @@ Changes to be committed:
 Unmerged paths:
   (use "git rm <file>..." to mark resolution)
 
 Unmerged paths:
   (use "git rm <file>..." to mark resolution)
 
-       both deleted:       main.txt
+       both deleted:    main.txt
 
 Untracked files not listed (use -u option to show untracked files)
 EOF
 
 Untracked files not listed (use -u option to show untracked files)
 EOF
index 3cec57af1ee0ca8ccbbbdc47871cd4ff07e0d034..68ad2d7454d6cbc93b5f7109fe836138c95ba684 100755 (executable)
@@ -33,7 +33,7 @@ You have unmerged paths.
 Unmerged paths:
   (use "git add <file>..." to mark resolution)
 
 Unmerged paths:
   (use "git add <file>..." to mark resolution)
 
-       both modified:      main.txt
+       both modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
 
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
@@ -87,7 +87,7 @@ Unmerged paths:
   (use "git reset HEAD <file>..." to unstage)
   (use "git add <file>..." to mark resolution)
 
   (use "git reset HEAD <file>..." to unstage)
   (use "git add <file>..." to mark resolution)
 
-       both modified:      main.txt
+       both modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
 
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
@@ -146,7 +146,7 @@ Unmerged paths:
   (use "git reset HEAD <file>..." to unstage)
   (use "git add <file>..." to mark resolution)
 
   (use "git reset HEAD <file>..." to unstage)
   (use "git add <file>..." to mark resolution)
 
-       both modified:      main.txt
+       both modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
 
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
@@ -602,7 +602,7 @@ rebase in progress; onto $ONTO
 You are currently rebasing branch '\''statushints_disabled'\'' on '\''$ONTO'\''.
 
 Unmerged paths:
 You are currently rebasing branch '\''statushints_disabled'\'' on '\''$ONTO'\''.
 
 Unmerged paths:
-       both modified:      main.txt
+       both modified:   main.txt
 
 no changes added to commit
 EOF
 
 no changes added to commit
 EOF
@@ -636,7 +636,7 @@ You are currently cherry-picking commit $TO_CHERRY_PICK.
 Unmerged paths:
   (use "git add <file>..." to mark resolution)
 
 Unmerged paths:
   (use "git add <file>..." to mark resolution)
 
-       both modified:      main.txt
+       both modified:   main.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
 
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
@@ -707,7 +707,7 @@ Unmerged paths:
   (use "git reset HEAD <file>..." to unstage)
   (use "git add <file>..." to mark resolution)
 
   (use "git reset HEAD <file>..." to unstage)
   (use "git add <file>..." to mark resolution)
 
-       both modified:      to-revert.txt
+       both modified:   to-revert.txt
 
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
 
 no changes added to commit (use "git add" and/or "git commit -a")
 EOF
index b1b018e54e9823a4bb73f40a612e340ed5fd47e5..6f3ed67fc9a6af755f015e38b4c9ce934e79cb95 100644 (file)
@@ -318,8 +318,6 @@ static void wt_status_print_unmerged_data(struct wt_status *s,
        if (!padding) {
                label_width = maxwidth(wt_status_unmerged_status_string, 1, 7);
                label_width += strlen(" ");
        if (!padding) {
                label_width = maxwidth(wt_status_unmerged_status_string, 1, 7);
                label_width += strlen(" ");
-               if (label_width < 20)
-                       label_width = 20;
                padding = xmallocz(label_width);
                memset(padding, ' ', label_width);
        }
                padding = xmallocz(label_width);
                memset(padding, ' ', label_width);
        }