Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit c7cb333

Browse files
committed
wt-status: lift the artificual "at least 20 columns" floor
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 <[email protected]>
1 parent 8f17f5b commit c7cb333

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

t/t7060-wtstatus.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ You have unmerged paths.
3838
Unmerged paths:
3939
(use "git add/rm <file>..." as appropriate to mark resolution)
4040
41-
deleted by us: foo
41+
deleted by us: foo
4242
4343
no changes added to commit (use "git add" and/or "git commit -a")
4444
EOF
@@ -142,8 +142,8 @@ You have unmerged paths.
142142
Unmerged paths:
143143
(use "git add/rm <file>..." as appropriate to mark resolution)
144144
145-
both added: conflict.txt
146-
deleted by them: main.txt
145+
both added: conflict.txt
146+
deleted by them: main.txt
147147
148148
no changes added to commit (use "git add" and/or "git commit -a")
149149
EOF
@@ -175,9 +175,9 @@ You have unmerged paths.
175175
Unmerged paths:
176176
(use "git add/rm <file>..." as appropriate to mark resolution)
177177
178-
both deleted: main.txt
179-
added by them: sub_master.txt
180-
added by us: sub_second.txt
178+
both deleted: main.txt
179+
added by them: sub_master.txt
180+
added by us: sub_second.txt
181181
182182
no changes added to commit (use "git add" and/or "git commit -a")
183183
EOF
@@ -203,7 +203,7 @@ Changes to be committed:
203203
Unmerged paths:
204204
(use "git rm <file>..." to mark resolution)
205205
206-
both deleted: main.txt
206+
both deleted: main.txt
207207
208208
Untracked files not listed (use -u option to show untracked files)
209209
EOF

t/t7512-status-help.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ You have unmerged paths.
3333
Unmerged paths:
3434
(use "git add <file>..." to mark resolution)
3535
36-
both modified: main.txt
36+
both modified: main.txt
3737
3838
no changes added to commit (use "git add" and/or "git commit -a")
3939
EOF
@@ -87,7 +87,7 @@ Unmerged paths:
8787
(use "git reset HEAD <file>..." to unstage)
8888
(use "git add <file>..." to mark resolution)
8989
90-
both modified: main.txt
90+
both modified: main.txt
9191
9292
no changes added to commit (use "git add" and/or "git commit -a")
9393
EOF
@@ -146,7 +146,7 @@ Unmerged paths:
146146
(use "git reset HEAD <file>..." to unstage)
147147
(use "git add <file>..." to mark resolution)
148148
149-
both modified: main.txt
149+
both modified: main.txt
150150
151151
no changes added to commit (use "git add" and/or "git commit -a")
152152
EOF
@@ -602,7 +602,7 @@ rebase in progress; onto $ONTO
602602
You are currently rebasing branch '\''statushints_disabled'\'' on '\''$ONTO'\''.
603603
604604
Unmerged paths:
605-
both modified: main.txt
605+
both modified: main.txt
606606
607607
no changes added to commit
608608
EOF
@@ -636,7 +636,7 @@ You are currently cherry-picking commit $TO_CHERRY_PICK.
636636
Unmerged paths:
637637
(use "git add <file>..." to mark resolution)
638638
639-
both modified: main.txt
639+
both modified: main.txt
640640
641641
no changes added to commit (use "git add" and/or "git commit -a")
642642
EOF
@@ -707,7 +707,7 @@ Unmerged paths:
707707
(use "git reset HEAD <file>..." to unstage)
708708
(use "git add <file>..." to mark resolution)
709709
710-
both modified: to-revert.txt
710+
both modified: to-revert.txt
711711
712712
no changes added to commit (use "git add" and/or "git commit -a")
713713
EOF

wt-status.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,6 @@ static void wt_status_print_unmerged_data(struct wt_status *s,
318318
if (!padding) {
319319
label_width = maxwidth(wt_status_unmerged_status_string, 1, 7);
320320
label_width += strlen(" ");
321-
if (label_width < 20)
322-
label_width = 20;
323321
padding = xmallocz(label_width);
324322
memset(padding, ' ', label_width);
325323
}

0 commit comments

Comments
 (0)