clarification on git-update-index --remove

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, can someone who understands the index in git please clarify something
for me? Looking at the documentation it's not totally clear which entites
are referred to by "removed" and what that then implies.

from git-1.4.4.3/Documentation/git-update-index.txt <<<<<<<<<<<
--remove::
	If a specified file is in the index but is missing then it's
	removed.
	Default behavior is to ignore removed file.
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

I currently take this to mean

"With --remove, if there is a filepath in the index
and that filepath is in the list of files being fed to this instance
of git-update-index but in the working directory tree that filepath
does not currently exist, then upon termination remove the
filepath's record from the index.
[This means at the next commit it will not be present
at all in the set of files recorded via this commit.]

Default behaviour in that situation is to leave the index's
current record unaltered.
[This means that that filename will be, upon a commit,
recorded as having whatever sha-content the index currently records
it as having.]"

If this reading is right, this means that I have to pass the names of
files that have been removed otherwise they'll stay with their "last
contents before removal"? I'm currently finding removed files
"stay around in snapshots with their ultimate contents", and I now
_think_ this is the reason but I'm not sure.

(In case anyone's wants to know the context, I traced through and
distilled git-commit.sh to what I think
I need (rexpressed in python) with the core "make snapshot" code being

<<<<<<<<<<<<<<<<
   p1=loggedPopen(["git-update-index","-z","--add","--remove","--stdin"],
                  stdin=PIPE)
   for (d,fs) in files.iteritems(): # enters only "to be recorded" items
       for f in fs:
           p1.stdin.write(os.path.join(d,f)+"\0")
   p1.stdin.close()
   p1.wait()
   tree=loggedPopen(["git-write-tree"],stdout=PIPE).communicate()[0].rstrip()
   commit=loggedPopen(["git-commit-tree",tree,"-p","HEAD"],
                      stdin=PIPE,stdout=PIPE).communicate("cv")[0].rstrip()
<<<<<<<<<<<<<<<<<

Here files contains the set of files to be recorded in the current snapshot,
structured as (directory,set of files in directory).)

Many thanks for any insight,
--
cheers, dave tweed__________________________
david "DOT" tweed "AT" gmail "DOT" com
Rm 124, School of Systems Engineering, University of Reading.
Details are all that matters; God dwells there, and you never get to
see Him if you don't struggle to get them right. -- Stephen Jay Gould
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]