public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Maaartin <grajcar1@seznam•cz>
To: git@vger•kernel.org
Subject: Commiting automatically (2)
Date: Sun, 19 Dec 2010 08:29:50 +0000 (UTC)	[thread overview]
Message-ID: <loom.20101219T090500-396@post.gmane.org> (raw)

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

             reply	other threads:[~2010-12-19  8:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-19  8:29 Maaartin [this message]
2010-12-19 15:08 ` Commiting automatically (2) 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

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=loom.20101219T090500-396@post.gmane.org \
    --to=grajcar1@seznam$(echo .)cz \
    --cc=git@vger$(echo .)kernel.org \
    /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