git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "pradeep singh rautela" <rautelap@gmail.com>
To: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>
Cc: "Jeff King" <peff@peff.net>, "Junio C Hamano" <gitster@pobox.com>,
	"Adam Piatyszek" <ediap@users.sourceforge.net>,
	"Linus Torvalds" <torvalds@linux-foundation.org>,
	git@vger.kernel.org
Subject: Re: [PATCH] gitignore(5): Allow "foo/" in ignore list to match directory "foo"
Date: Thu, 31 Jan 2008 17:26:18 +0530	[thread overview]
Message-ID: <6bc632150801310356w1b2fa019n87d92986aed807c5@mail.gmail.com> (raw)
In-Reply-To: <alpine.LSU.1.00.0801311128190.23907@racer.site>

On 31/01/2008, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
[snip]
>
> Just to add my two eurocents: I think the patch is complicated enough that
> we could go the other way round: while parsing the ignore entries, we can
> plainly state that entries with a trailing slash are ignored:
>
> -- snipsnap --
> [PATCH] Warn if an ignore/exclude entry ends in a slash
>
> Git does not like ignore entries ending in a slash; they will be ignored.
> So just be honest and warn the user about it.
>
> Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
>
> ---
>
>  dir.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/dir.c b/dir.c
> index 1b9cc7a..c3e9a0d 100644
> --- a/dir.c
> +++ b/dir.c
> @@ -135,6 +135,11 @@ void add_exclude(const char *string, const char *base,
>         }
>         x->pattern = string;
>         x->patternlen = strlen(string);
> +       if (x->patternlen && x->pattern[x->patternlen - 1] == '/') {
> +               warning("Ignoring ignore entry because of trailing slash: %s",
> +                       string);

How about something like,
                  warning("Ignoring ignore entry because of trailing
slash: %s\n Remove the trailing slash from the directory name to
ignore it", string);

May be this will help absolute git newbies.
Please ignore this if it sounds like a "too trivial, everyone should
know this" case.

Thanks,
           --Pradeep
> +               return;
> +       }
>         x->base = base;
>         x->baselen = baselen;
>         x->flags = 0;
>


-- 
Pradeep Singh Rautela
http://eagain.wordpress.com
http://emptydomain.googlepages.com

  reply	other threads:[~2008-01-31 11:57 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-23 13:54 Why does git track directory listed in .gitignore/".git/info/exclude"? pradeep singh rautela
2008-01-23 14:04 ` pradeep singh rautela
2008-01-23 21:17   ` Linus Torvalds
2008-01-24 10:44     ` pradeep singh rautela
2008-01-30 12:35     ` Adam Piatyszek
2008-01-30 20:39       ` Junio C Hamano
2008-01-30 21:06         ` Junio C Hamano
2008-01-31  7:05         ` Adam Piatyszek
2008-01-31  8:54           ` *Re: " Junio C Hamano
2008-01-31  9:17             ` [PATCH] gitignore(5): Allow "foo/" in ignore list to match directory "foo" Junio C Hamano
2008-01-31  9:41               ` Jeff King
2008-01-31 10:35                 ` Junio C Hamano
2008-01-31 10:42                   ` Jeff King
2008-01-31 11:38                     ` Johannes Schindelin
2008-01-31 11:56                       ` pradeep singh rautela [this message]
2008-01-31 21:51                         ` Junio C Hamano
2008-01-31 22:53                           ` Adam Piatyszek
2008-02-01  8:56                           ` Andreas Ericsson
2008-01-31 12:29                       ` Adam Piatyszek
2008-01-23 21:11 ` Why does git track directory listed in .gitignore/".git/info/exclude"? Wayne Davison

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=6bc632150801310356w1b2fa019n87d92986aed807c5@mail.gmail.com \
    --to=rautelap@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=ediap@users.sourceforge.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    --cc=torvalds@linux-foundation.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).