From: Andreas Ericsson <ae@op5•se>
To: Junio C Hamano <junkio@cox•net>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx•de>, git@vger•kernel.org
Subject: Re: [PATCH 5/5] git-add: add ignored files when asked explicitly.
Date: Thu, 04 Jan 2007 14:58:57 +0100 [thread overview]
Message-ID: <459D0821.10204@op5.se> (raw)
In-Reply-To: <7vslf3khsc.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx•de> writes:
>
>> On Mon, 25 Dec 2006, Junio C Hamano wrote:
>>
>>> $ git add foo.o
>>> $ git add '*.o'
>> Most people do
>>
>> $ git add *.o
>>
>> instead, where bash expands the expression. Maybe this new behaviour
>> should be hidden between a "-f" option?
>
> When would anybody do "git add *.o"?
>
Make that "git add *.c" then, in a directory normally containing a lot
of generated C-files.
>
> An alternative is to use the mechanism I added here to _detect_
> the attempt to add an ignored file with explicitly spelled out
> pathspec, and issue an info message that says something like:
>
> Path 'xyzzy/filfre.o' is not being ignored by one of
> your .gitignore files. If you really want to add it,
> please add this entry to .gitignore file:
>
> !/xyzzy/filfre.o
>
Sounds very sensible to me, although I assume you meant "path
xyzzy/filfre.o is being ignored" (ie, "is not being ignored" (sic) was a
typo).
> One advantage of this is that it would help guiding the user in
> the right direction, giving a reusable piece of knowledge,
> without changing the behaviour of the command (what is refused
> is refused). But I can already see people's complaints: if the
> tool knows how to fix that situation why forces the user to do
> so?
>
> Although the reason why the alternative does not do so is "The
> user earlier said *.o files are uninteresting but came back with
> a conflicting request to add xyzzy/filfre.o, which could be a
> mistake. We ask for a confirmation", which is very sensible,
Very sensible indeed. If you tell a cabdriver "go-left-go-right" (very
fast) he'll (hopefully) stop and ask you where you really wanted to go.
> another alternative would be to add the path anyway and issue an
> warning, like this:
>
> $ ls xyzzy
> filfre.c filfre.o
> $ git add xyzzy/filfre.?
> added ignored path xyzzy/filfre.o
>
I like the "you did something weird. Education served" option better.
--
Andreas Ericsson andreas.ericsson@op5•se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
prev parent reply other threads:[~2007-01-04 13:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-25 11:13 [PATCH 5/5] git-add: add ignored files when asked explicitly Junio C Hamano
2006-12-25 13:47 ` Johannes Schindelin
2006-12-25 17:27 ` Junio C Hamano
2006-12-25 18:39 ` [PATCH] git-add: warn when adding an ignored file with an explicit request Junio C Hamano
2006-12-25 22:24 ` Jakub Narebski
2006-12-26 16:19 ` Johannes Schindelin
2006-12-25 19:57 ` [PATCH 5/5] git-add: add ignored files when asked explicitly Nicolas Pitre
2006-12-26 15:34 ` Johannes Schindelin
2006-12-26 19:05 ` Junio C Hamano
2006-12-26 22:48 ` Johannes Schindelin
2007-01-04 13:58 ` Andreas Ericsson [this message]
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=459D0821.10204@op5.se \
--to=ae@op5$(echo .)se \
--cc=Johannes.Schindelin@gmx$(echo .)de \
--cc=git@vger$(echo .)kernel.org \
--cc=junkio@cox$(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