zsh-workers
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Jun T <takimoto-j@kba.biglobe.ne.jp>
Cc: zsh-workers@zsh.org
Subject: Re: [PATCH 3/3] completion: make: fix whitespaces
Date: Thu, 4 Aug 2022 10:57:51 -0500	[thread overview]
Message-ID: <CAMP44s1hg9mKB9Gp+hnVP0Y37x+ZK=r1p6yzx9hF8PSVJdLEig@mail.gmail.com> (raw)
In-Reply-To: <473642FA-6178-4DD1-8B97-2250B1EED661@kba.biglobe.ne.jp>

On Thu, Aug 4, 2022 at 3:55 AM Jun T <takimoto-j@kba.biglobe.ne.jp> wrote:
>
> As this patch shows, _make has some indentation problems
> (and also lots of other scripts have them).
>
> > 2022/07/30 10:03, Felipe Contreras <felipe.contreras@gmail.com> write:
> >
> > diff --git a/Completion/Unix/Command/_make b/Completion/Unix/Command/_make
>
> > @@ -12,35 +12,35 @@ _make-expandVars() {
> >
> >     case $rest[2] in
> >       ($)         # '$$'. may not appear in target and variable's value
> > -     front=$front\$\$
> > -     rest=${rest[3,-1]}
> > -     continue
> > -     ;;
> > +        front=$front\$\$
> > +        rest=${rest[3,-1]}
> (snip)
>
> # I didn't know that indent_style for scripts has changed from
> # tab to space.
>
> I have a vague memory of argument that it's not good to fix indent of
> lines not related with the real fix because it makes 'git blame'
> rather useless, and then someone wrote that 'git blame -w' can be used
> in that case.

Even if -w didn't exist, `git blame` can find previous modifications,
it's not just a tool to find the last one, so it wouldn't be
"useless".

You can tell it to start from the previous commit that made modifications:

    git blame 6ab65fae7a~ -L12,35 Completion/Unix/Command/_make

And you can of course list *all* the previous modifications to those lines:

    git log -L12,35:Completion/Unix/Command/_make

> So, in general, is it better (or not) to apply this type of patch?

I've sent many patches like this one to the git project itself, so
presumably git has no trouble with them.

Ultimately it's up to you (the developers). Do you want to have
inconsistent whitespaces forever (or at least until somebody modifies
those lines, which seems to happen every 5 years)? Or would you rather
have it clean now?

Personally, sometimes I use ts=2 in shell scripts, so it's very
annoying to see those badly indented lines, but your mileage may vary.

Cheers.

-- 
Felipe Contreras


  reply	other threads:[~2022-08-04 15:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-30  1:03 [PATCH 0/3] completion: make: various improvements Felipe Contreras
2022-07-30  1:03 ` [PATCH 1/3] completion: make: don't build everything Felipe Contreras
2022-07-30  1:03 ` [PATCH 2/3] completion: make: add a simpler parser Felipe Contreras
2022-07-30  1:03 ` [PATCH 3/3] completion: make: fix whitespaces Felipe Contreras
2022-08-04  8:50   ` Jun T
2022-08-04 15:57     ` Felipe Contreras [this message]
2022-08-02 10:42 ` [PATCH 0/3] completion: make: various improvements Jun T
2022-08-02 23:02   ` Felipe Contreras
2022-08-03  8:48     ` Jun T
2022-08-03 14:36       ` Felipe Contreras
2022-08-04  9:33         ` Jun T
2022-08-04 17:03           ` Felipe Contreras

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='CAMP44s1hg9mKB9Gp+hnVP0Y37x+ZK=r1p6yzx9hF8PSVJdLEig@mail.gmail.com' \
    --to=felipe.contreras@gmail.com \
    --cc=takimoto-j@kba.biglobe.ne.jp \
    --cc=zsh-workers@zsh.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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).