From 2d8cf94b28de9da683ddd40961a3a572f2741cf3 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 29 Mar 2024 15:57:06 -0700 Subject: advice: omit trailing whitespace Git tools all consistently encourage users to avoid whitespaces at the end of line by giving them features like "git diff --check" and "git am --whitespace=fix". Make sure that the advice messages we give users avoid trailing whitespaces. We shouldn't be wasting vertical screen real estate by adding blank lines in advice messages that are supposed to be concise hints, but as long as we write such blank line in our "hints", we should do it right. A test that expects the current behaviour of leaving trailing whitespaces has been adjusted. Signed-off-by: Junio C Hamano --- t/t3200-branch.sh | 4 ++-- t/t7004-tag.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 't') diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh index d3bbd00b81..ccfa6a720d 100755 --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@ -1154,9 +1154,9 @@ test_expect_success 'avoid ambiguous track and advise' ' hint: tracking ref '\''refs/heads/main'\'': hint: ambi1 hint: ambi2 - hint: '' + hint: hint: This is typically a configuration error. - hint: '' + hint: hint: To support setting up tracking branches, ensure that hint: different remotes'\'' fetch refspecs map into different hint: tracking namespaces. diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index b41a47eb94..696866d779 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -1777,10 +1777,10 @@ test_expect_success '--points-at finds annotated tags of tags' ' ' test_expect_success 'recursive tagging should give advice' ' - sed -e "s/|$//" <<-EOF >expect && + cat >expect <<-EOF && hint: You have created a nested tag. The object referred to by your new tag is hint: already a tag. If you meant to tag the object that it points to, use: - hint: | + hint: hint: git tag -f nested annotated-v4.0^{} hint: Disable this message with "git config advice.nestedTag false" EOF -- cgit 1.2.3-korg