git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Josh Triplett <josh@freedesktop.org>
Cc: git@vger.kernel.org, Brian Downing <bdowning@lavos.net>,
	dsymonds@gmail.com
Subject: Re: [PATCH 2/2] git-diff: complain about >=8 consecutive spaces in initial indent
Date: Tue, 13 Nov 2007 16:46:19 -0800	[thread overview]
Message-ID: <7vabphr6w4.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <473A3552.3060907@freedesktop.org> (Josh Triplett's message of "Tue, 13 Nov 2007 15:37:54 -0800")

Josh Triplett <josh@freedesktop.org> writes:

> My standard test case for this:
>
> fprintf("some very long string",
>         arguments);
>
> Type the first line, and press enter.  A good editor should indent to
> the open parenthesis.  However, it should not use a tab, because it
> needs to match up with the length of "fprintf(".

Sorry, I do not want to go into ideology or be anal, but I have
to disagree.  Tab width is 8 spaces (in the kernel and git), so
"fprintf(" from the beginning of the line and an HT at the
beginning of the line have the same width.

Your project may have different conventions.  Then you do not
have to use that option to check for 8 or more leading spaces.

And honestly, I think responding to that by saying "but somebody
can have tab width that is not 8" is irrelevant.  Somebody else
can even use a non-proportional font to print it, so your 8
spaces and "fprintf(" won't line up ANYWAY.

If you REALLY want to be anal, then the rules to follow would
be:

 - Do not assume you know the width of a HT, other than that the
   same number of HT at the beginning of two lines indent to the
   same distance from the left margin, and more of them indent
   deeper;

 - Do not assume the text will be printed in monospace;

which leads to:

 - Indent with the same number of HT from the beginning of
   lines.  Go deeper with one more HT, go shallower with one
   less HT.

 - Start the continuation line with the same number of HT to
   indent but DO NOT BOTHER aligning.  There is no alignment,
   period.

I happen to choose to be less anal, and accept 8 space HT _and_
monospace font.  So "complaining at >=8 SP at the beginning"
makes perfect sense, so does a corresponding patch to convert
such runs of SPs to HTs with "git-apply --whitespace=fix" (which
should require an option to be enabled, and the is not here
yet) when applying a patch.

  reply	other threads:[~2007-11-14  0:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-02  7:34 [PATCH 1/2] War on whitespace: first, a bit of retreat Junio C Hamano
2007-11-02  7:38 ` [PATCH 2/2] git-diff: complain about >=8 consecutive spaces in initial indent Junio C Hamano
2007-11-13 23:37   ` Josh Triplett
2007-11-14  0:46     ` Junio C Hamano [this message]
2007-11-02 10:14 ` [PATCH 1/2] War on whitespace: first, a bit of retreat David Symonds
2007-11-02 10:45   ` Andreas Ericsson
2007-11-02 11:50     ` David Symonds
2007-11-02 12:25       ` Jakub Narebski
2007-11-02 12:53         ` David Symonds
2007-11-02 13:26           ` David Symonds
2007-11-02 17:45 ` J. Bruce Fields
2007-11-03  2:45   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vabphr6w4.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=bdowning@lavos.net \
    --cc=dsymonds@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=josh@freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).