git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Commiting automatically (2)
@ 2010-12-19  8:29 Maaartin
  2010-12-19 15:08 ` Taylor Hedberg
  2010-12-19 19:32 ` Junio C Hamano
  0 siblings, 2 replies; 13+ messages in thread
From: Maaartin @ 2010-12-19  8:29 UTC (permalink / raw)
  To: git

Some time ago I asked how to make a commit of the working tree in a way 
influencing neither the current branch nor the index:
http://comments.gmane.org/gmane.comp.version-control.git/157056
I'm going to use it for taking a snapshot of the current working tree without 
disturbing my work. It seem to work except for one thing:

There are files tracked by git and later added to .gitignore. AFAIK listing 
them in .gitignore is a no-op, since I haven't removed them from the index. 
Until now I haven't known about them at all, I'm currently undecided what to do 
to them.

However, when I use my git-autocom script, those files get marked as deleted. 
This is quite strange, especially because of them still existing. I'd strongly 
prefer git-autocom to behave just like git commit (i.e., tracking the files).

The relevant part of my script follows:

export GIT_INDEX_FILE=.git/autocom.tmp
git add -A &&
tree=$(git write-tree) &&
commit=$(echo "$message" | git commit-tree $tree $parent1 $parent2) &&
git update-ref -m "$message" refs/heads/autocom $commit

I'd say using another index is the reason for this behavior. The index gets 
created on the first use, which is probably why those files look like being 
deleted. Should I always
/bin/cp .git/index $GIT_INDEX_FILE
or is there a better way?

There's one more problem. My script doesn't recognize deleted files, since
git add -A
does nothing to them. I'm quite sure I saw a solution to this, but can't find 
it now...

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-01-03 17:34 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-19  8:29 Commiting automatically (2) Maaartin
2010-12-19 15:08 ` Taylor Hedberg
2010-12-19 18:36   ` Jonathan Nieder
2010-12-19 20:17     ` Jonathan Nieder
2010-12-20  5:12     ` Maaartin
2010-12-19 19:32 ` Junio C Hamano
2010-12-20  5:46   ` Maaartin
2010-12-20  7:33     ` Enrico Weigelt
2010-12-21  8:36       ` Maaartin
2010-12-21 13:06         ` Jakub Narebski
     [not found]           ` <4D1190A6.4070201@seznam.cz>
2010-12-27 12:04             ` Jakub Narebski
2011-01-03  0:39               ` Maaartin-1
2011-01-03 17:34                 ` Jakub Narebski

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).