Re: [PATCH 0/2] git-add: -s flag (silently ignore files)

2012-10-01 Thread Junio C Hamano
Olaf Klischat  writes:

> ... scenarios where you want to feed the file list into git add
> via find or other external commands (`find  | xargs git add'),
> which you wouldn't want to carefully tune...

Can you explain this kind of thing in the actual commit log message
when you reroll (if you will do so)?

I also cannot help but find that `scenario` an artificially made-up
one.  The description did not feel convincing enough, even if it
were in the proposed commit log message, to justify such an option.

A few questions.

 - What were the kind of patterns useful in the above `find` in your
   real life example?

 - The use of `find` means giving pathspecs from the command line,
   e.g. "git add foo/ \*.rb", wouldn't have been sufficient. Are
   there something we could improve this in more direct way?

 - Why was it too cumbersome to add the idiomatic

\( -name '*.o' -o -name '*~' \) -prune -o

   or something like that in front of whatever patterns were used?

 - Perhaps a filter that takes a list of paths and emits only the
   ignored paths (or only the unignored paths) would be a more
   generic approach?  You could feed the output from `find` to such
   a filter, and then drive not just "git add" but other commands
   that take paths if you solved it that way.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/2] git-add: -s flag (silently ignore files)

2012-10-01 Thread Olaf Klischat
This adds an -s|--silent-ignore option to git-add, which causes
ignored files that were specified explicitly on the command line to be
silently ignored, rather than abandoning the command. I found this
useful for scenarios where you want to feed the file list into git add
via find or other external commands (`find  | xargs git add'),
which you wouldn't want to carefully tune so they don't output any
ignored files. git ls-files doesn't have find's filtering
capabilities, and using it in place of find would kind of violate "one
job one tool" anyway. I'm not really a git guru, so maybe I'm missing
something, and I'm unsure how useful this new option is for a general
audience. OTOH the patch is trivial. Check it out.

The update applies on top of "master" (261b5119).

Olaf Klischat (2):
  git-add: -s flag added (silently ignore files)
  git-add: -s flag: documentation added

 Documentation/git-add.txt |   15 +++
 builtin/add.c |   14 +++---
 t/t3700-add.sh|   17 -
 3 files changed, 38 insertions(+), 8 deletions(-)

-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html