* [PATCH 0/1] diff-highlight: fix a whitespace nit
@ 2019-10-15 3:31 Norman Rasmussen via GitGitGadget
2019-10-15 3:31 ` [PATCH 1/1] " Norman Rasmussen via GitGitGadget
0 siblings, 1 reply; 4+ messages in thread
From: Norman Rasmussen via GitGitGadget @ 2019-10-15 3:31 UTC (permalink / raw)
To: git; +Cc: Norman Rasmussen, Junio C Hamano
This changes the indent from
"<tab><sp><sp><sp><sp><sp><sp><sp><sp>"
to
"<tab><tab>"
so that the statement lines up with the rest of the block.
Signed-off-by: Norman Rasmussen <norman@rasmussen.co.za>
Norman Rasmussen (1):
diff-highlight: fix a whitespace nit
contrib/diff-highlight/DiffHighlight.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
base-commit: 08da6496b61341ec45eac36afcc8f94242763468
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-397%2Fnormanr%2Fdiff-highlight-whitespace-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-397/normanr/diff-highlight-whitespace-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/397
--
gitgitgadget
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/1] diff-highlight: fix a whitespace nit
2019-10-15 3:31 [PATCH 0/1] diff-highlight: fix a whitespace nit Norman Rasmussen via GitGitGadget
@ 2019-10-15 3:31 ` Norman Rasmussen via GitGitGadget
2019-10-15 4:20 ` Jeff King
0 siblings, 1 reply; 4+ messages in thread
From: Norman Rasmussen via GitGitGadget @ 2019-10-15 3:31 UTC (permalink / raw)
To: git; +Cc: Norman Rasmussen, Junio C Hamano, Norman Rasmussen
From: Norman Rasmussen <norman@rasmussen.co.za>
This changes the indent from
"<tab><sp><sp><sp><sp><sp><sp><sp><sp>"
to
"<tab><tab>"
so that the statement lines up with the rest of the block.
Signed-off-by: Norman Rasmussen <norman@rasmussen.co.za>
---
contrib/diff-highlight/DiffHighlight.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/contrib/diff-highlight/DiffHighlight.pm b/contrib/diff-highlight/DiffHighlight.pm
index 7440aa1c46..e2589922a6 100644
--- a/contrib/diff-highlight/DiffHighlight.pm
+++ b/contrib/diff-highlight/DiffHighlight.pm
@@ -72,7 +72,7 @@ sub handle_line {
(?:$COLOR?\|$COLOR?[ ])* # zero or more trailing "|"
[ ]* # trailing whitespace for merges
/x) {
- my $graph_prefix = $&;
+ my $graph_prefix = $&;
# We must flush before setting graph indent, since the
# new commit may be indented differently from what we
--
gitgitgadget
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] diff-highlight: fix a whitespace nit
2019-10-15 3:31 ` [PATCH 1/1] " Norman Rasmussen via GitGitGadget
@ 2019-10-15 4:20 ` Jeff King
2019-10-15 4:34 ` Norman Rasmussen
0 siblings, 1 reply; 4+ messages in thread
From: Jeff King @ 2019-10-15 4:20 UTC (permalink / raw)
To: Norman Rasmussen via GitGitGadget; +Cc: git, Norman Rasmussen, Junio C Hamano
On Tue, Oct 15, 2019 at 03:31:26AM +0000, Norman Rasmussen via GitGitGadget wrote:
> From: Norman Rasmussen <norman@rasmussen.co.za>
>
> This changes the indent from
> "<tab><sp><sp><sp><sp><sp><sp><sp><sp>"
> to
> "<tab><tab>"
> so that the statement lines up with the rest of the block.
Yep, that makes sense. Looks like I introduced the problem (most of my
perl used to be written in a style that forbids tabs, so it may have
snuck in that way, but the rest of the file definitely follows Git's
usual style of tabs).
> diff --git a/contrib/diff-highlight/DiffHighlight.pm b/contrib/diff-highlight/DiffHighlight.pm
> index 7440aa1c46..e2589922a6 100644
> --- a/contrib/diff-highlight/DiffHighlight.pm
> +++ b/contrib/diff-highlight/DiffHighlight.pm
> @@ -72,7 +72,7 @@ sub handle_line {
> (?:$COLOR?\|$COLOR?[ ])* # zero or more trailing "|"
> [ ]* # trailing whitespace for merges
> /x) {
> - my $graph_prefix = $&;
> + my $graph_prefix = $&;
There are a few lines just above that have 8+ spaces. Arguably those
could be tabs, too, depending on your view of tabs. We usually do "8
spaces is a tab" in the Git project, but the oft-repeated "tabs to
indent, spaces to align" mantra would apply here (and I suspect you're
using a different tabwidth since you noticed this one case). So I'd just
as soon leave them be, and take your patch as-is.
-Peff
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] diff-highlight: fix a whitespace nit
2019-10-15 4:20 ` Jeff King
@ 2019-10-15 4:34 ` Norman Rasmussen
0 siblings, 0 replies; 4+ messages in thread
From: Norman Rasmussen @ 2019-10-15 4:34 UTC (permalink / raw)
To: Jeff King; +Cc: Norman Rasmussen via GitGitGadget, git, Junio C Hamano
On Mon, Oct 14, 2019 at 9:20 PM Jeff King <peff@peff.net> wrote:
> There are a few lines just above that have 8+ spaces. Arguably those
> could be tabs, too, depending on your view of tabs. We usually do "8
> spaces is a tab" in the Git project, but the oft-repeated "tabs to
> indent, spaces to align" mantra would apply here (and I suspect you're
> using a different tabwidth since you noticed this one case). So I'd just
> as soon leave them be, and take your patch as-is.
Yep, the lines above are using the spaces to align the sections of the
multi-line if statement. This happens again for the return statements
in highlight_pair and is_pair_interesting. So this is the only line
that doesn't stick to the rule (and probably because of editor
auto-indenting). I have another change for the same change (which I'll
send once I've written tests) and I only noticed this line when I
changed my editor's default tabwidth after a while of coding.
--
- Norman Rasmussen
- Email: norman@rasmussen.co.za
- Home page: http://norman.rasmussen.co.za/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-10-15 4:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-15 3:31 [PATCH 0/1] diff-highlight: fix a whitespace nit Norman Rasmussen via GitGitGadget
2019-10-15 3:31 ` [PATCH 1/1] " Norman Rasmussen via GitGitGadget
2019-10-15 4:20 ` Jeff King
2019-10-15 4:34 ` Norman Rasmussen
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).