public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Jeff King <peff@peff•net>
Cc: Michael J Gruber <git@drmicha•warpmail.net>, git@vger•kernel.org
Subject: Re: [RFD/PATCH] add: ignore only ignored files
Date: Wed, 19 Nov 2014 13:43:52 -0800	[thread overview]
Message-ID: <xmqqbno2rhlz.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20141119191502.GC9908@peff.net> (Jeff King's message of "Wed, 19 Nov 2014 14:15:02 -0500")

Jeff King <peff@peff•net> writes:

> Typically I keep a very neat .gitignore file and just use "git add .",
> which _does_ ignore those files. The real problem here is that git
> cannot tell the difference between "the user explicitly asked for
> foo.aux, so we should complain" and "oops, foo.aux got caught in a shell
> expansion".

Yup.  I also find myself doing "git cmd -- \*.ext" to let Git, not
my shell, handle the patterns.

> I almost wonder if skipping ignored files should _always_ be a warning,
> not a hard error. I guess that has unpleasant side effects for scripts
> which call "git add XXX" and check the exit code, who may be
> unpleasantly surprised that they missed out on some content.
>
> Perhaps we could do a hybrid: add the files that were not ignored, but
> then still exit non-zero. Careful scripts need to check the exit status
> of "git add" anyway, and sloppy humans with over-broad wildcards
> typically do not care about the exit status.

;-)

  reply	other threads:[~2014-11-19 21:43 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-19 14:52 [RFD/PATCH] add: ignore only ignored files Michael J Gruber
2014-11-19 18:51 ` Junio C Hamano
2014-11-19 19:15 ` Jeff King
2014-11-19 21:43   ` Junio C Hamano [this message]
2014-11-20  9:42     ` Michael J Gruber
2014-11-20 15:56       ` Jeff King
2014-11-20 17:23         ` Junio C Hamano
2014-11-20 18:20           ` Jeff King
2014-11-21 15:39             ` Michael J Gruber
2014-11-21 16:08               ` [PATCHv2] " Michael J Gruber
2014-11-21 18:01                 ` Jeff King
2014-11-22 14:59                   ` Torsten Bögershausen
2014-11-22 19:19                     ` Jeff King
2014-11-22 21:20                       ` Torsten Bögershausen
2014-11-23 19:50                         ` Jeff King
2014-11-23 18:10                       ` Junio C Hamano
2014-11-23 19:46                         ` Jeff King
2014-11-24 17:41                           ` Junio C Hamano
2014-11-24 20:22                             ` Torsten Bögershausen
2014-11-25  3:57                             ` Jeff King
2014-11-24 10:29                     ` Michael J Gruber
2014-11-24 10:23                   ` Michael J Gruber

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=xmqqbno2rhlz.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@drmicha$(echo .)warpmail.net \
    --cc=git@vger$(echo .)kernel.org \
    --cc=peff@peff$(echo .)net \
    /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