On Thu, 2013-03-28 at 16:43 -0400, Dale R. Worley wrote:
> If you think about it, in many situations "git commit -a" is what a
> software developer wants to use.  Various trash files can accumulate
> in a working copy; you usually only want to commit files that have
> been specially pointed out as being valuable.

Sure.  I'm not in any way saying "git commit -a" is doing the wrong
thing or should be modified...?  I'm talking about the behavior of "git
apply".  I don't really see many situations where you want to apply a
patch and have all the modifications and deletes be processed but not
the adds.

> > As an example of the kind of problem this creates, if I have a workspace
> > with some untracked files in it and then I run "git apply", I now have
> > no way to tell which files were created as part of the "git apply" and
> > should be added to my commit with "git add", and which were there before
> > and should not be added.
> 
> You really, really shouldn't use "git apply" unless the working copy
> is clean.  (Unless you want to combine the changes that "git apply"
> makes with all the changes that are already present to make one
> commit.)

I agree with you if by "working copy is clean" you mean there are no
modifications to Git-controlled files... that would be a problem.  And
in my case there are none.  I don't agree if by "clean" you mean that I
should be deleting the "various trash files that can accumulate in a
working copy"; these files may be important even though they shouldn't
be added to Git.  Since they're not known by Git, stash doesn't help.
It is a real PITA to move them outside of the repository while dealing
with patches, then move them back.  I don't want to require everyone to
do that just to apply patches.  The risk that some added file in the
patch will overlap with a local file already in my workspace is very
small, and if it happens then the patch will simply fail to apply.

Anyway, "git apply --index", while not quite what I wanted, is working
OK for me.  Cheers!

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to