-
Notifications
You must be signed in to change notification settings - Fork 142
diff-highlight: fix a whitespace nit #397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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 <[email protected]>
Welcome to GitGitGadgetHi @normanr, and welcome to GitGitGadget, the GitHub App to send patch series to the Git mailing list from GitHub Pull Requests. Please make sure that this Pull Request has a good description, as it will be used as cover letter. Also, it is a good idea to review the commit messages one last time, as the Git project expects them in a quite specific form:
It is in general a good idea to await the automated test ("Checks") in this Pull Request before contributing the patches, e.g. to avoid trivial issues such as unportable code. Contributing the patchesBefore you can contribute the patches, your GitHub username needs to be added to the list of permitted users. Any already-permitted user can do that, by adding a PR comment of the form Once on the list of permitted usernames, you can contribute the patches to the Git mailing list by adding a PR comment After you submit, GitGitGadget will respond with another comment that contains the link to the cover letter mail in the Git mailing list archive. Please make sure to monitor the discussion in that thread and to address comments and suggestions. If you want to see what email(s) would be sent for a submit request, add a PR comment If you do not want to subscribe to the Git mailing list just to be able to respond to a mail, you can download the mbox ("raw") file corresponding to the mail you want to reply to from the Git mailing list. If you use GMail, you can upload that raw mbox file via: curl -g --user "<EMailAddress>:<Password>" --url "imaps://imap.gmail.com/INBOX" -T /path/to/raw.txt |
/allow |
User normanr is now allowed to use GitGitGadget. |
/preview |
Preview email sent as [email protected] |
/submit |
Submitted as [email protected] |
@@ -72,7 +72,7 @@ sub handle_line { | |||
(?:$COLOR?\|$COLOR?[ ])* # zero or more trailing "|" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Jeff King wrote (reply to this):
On Tue, Oct 15, 2019 at 03:31:26AM +0000, Norman Rasmussen via GitGitGadget wrote:
> From: Norman Rasmussen <[email protected]>
>
> 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the Git mailing list, Norman Rasmussen wrote (reply to this):
On Mon, Oct 14, 2019 at 9:20 PM Jeff King <[email protected]> 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: [email protected]
- Home page: http://norman.rasmussen.co.za/
This branch is now known as |
This patch series was integrated into pu via git@d7a4f2b. |
This patch series was integrated into pu via git@00dd658. |
This patch series was integrated into pu via git@1f04512. |
This patch series was integrated into pu via git@13b7f1d. |
This patch series was integrated into pu via git@67da6b1. |
This patch series was integrated into next via git@8ce6000. |
This patch series was integrated into pu via git@ef90ad4. |
This patch series was integrated into pu via git@b895e8d. |
This patch series was integrated into next via git@b895e8d. |
This patch series was integrated into master via git@b895e8d. |
Closed via b895e8d. |
Uh oh!
There was an error while loading. Please reload this page.