public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery•net>
To: Sverre Rabbelier <srabbelier@gmail•com>
Cc: Junio C Hamano <gitster@pobox•com>,
	Noe Rubinstein <nrubinstein@proformatique•com>,
	git@vger•kernel.org
Subject: Re: [PATCH] rebase -i: fix has_action
Date: Fri, 05 Aug 2011 14:46:54 +0200	[thread overview]
Message-ID: <4E3BE63E.8030509@viscovery.net> (raw)
In-Reply-To: <CAGdFq_j2wRw-gB109VypZkG1u=fm7yynkn2-Gu8AzNpVOrun8w@mail.gmail.com>

Am 8/5/2011 14:36, schrieb Sverre Rabbelier:
> On Thu, Aug 4, 2011 at 21:34, Junio C Hamano <gitster@pobox•com> wrote:
>>        has_action () {
>>          test -s "$1"
>>        }
> 
>>        has_action () {
>>          sane_grep -v -e '^#' -e '^[   ]*$' "$1" >/dev/null
>>        }
> 
> I think the former more correctly checks what the function name
> implies, is there any downside to that which makes you suggest this
> second approach?

Yes. There might be editors where it is difficult to edit a non-empty file
so that it becomes empty. I recall this was a problem for me with vi
before I got intimately acquainted with it.

-- Hannes

  reply	other threads:[~2011-08-05 12:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-04  9:39 [PATCH] rebase -i: fix has_action Noe Rubinstein
2011-08-04 12:15 ` Sverre Rabbelier
2011-08-04 19:34 ` Junio C Hamano
2011-08-05 12:36   ` Sverre Rabbelier
2011-08-05 12:46     ` Johannes Sixt [this message]
2011-08-05 16:59     ` Junio C Hamano
2011-08-05 14:17   ` Andrew Wong
2011-08-05 17:01     ` Junio C Hamano
2011-08-05 14:47   ` What you can throw (on a Friday) Steffen Daode Nurpmeso

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=4E3BE63E.8030509@viscovery.net \
    --to=j.sixt@viscovery$(echo .)net \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    --cc=nrubinstein@proformatique$(echo .)com \
    --cc=srabbelier@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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