<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/read-cache.c, branch v1.2.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v1.2.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v1.2.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2005-12-20T22:18:47Z</updated>
<entry>
<title>ce_smudge_racily_clean_entry: explain why it works.</title>
<updated>2005-12-20T22:18:47Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2005-12-20T22:18:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4b3511b0f8422fd2c5b1b37c9655ae2ce904bca5'/>
<id>urn:sha1:4b3511b0f8422fd2c5b1b37c9655ae2ce904bca5</id>
<content type='text'>
This is a tricky code and warrants extra commenting.  I wasted
30 minutes trying to break it until I realized why it works.

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Racy GIT (part #2)</title>
<updated>2005-12-20T20:12:18Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2005-12-20T20:12:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=407c8eb0d09d4b84bbfda9e04895a35c8fd6fef6'/>
<id>urn:sha1:407c8eb0d09d4b84bbfda9e04895a35c8fd6fef6</id>
<content type='text'>
The previous round caught the most trivial case well, but broke
down once index file is updated again.  Smudge problematic
entries (they should be very few if any under normal interactive
workflow) before writing a new index file out.

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Racy GIT</title>
<updated>2005-12-20T08:22:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2005-12-20T08:02:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=29e4d3635709778bcc808dbad0477efad82f8d7e'/>
<id>urn:sha1:29e4d3635709778bcc808dbad0477efad82f8d7e</id>
<content type='text'>
This fixes the longstanding "Racy GIT" problem, which was pretty
much there from the beginning of time, but was first
demonstrated by Pasky in this message on October 24, 2005:

    http://marc.theaimsgroup.com/?l=git&amp;m=113014629716878

If you run the following sequence of commands:

	echo frotz &gt;infocom
        git update-index --add infocom
        echo xyzzy &gt;infocom

so that the second update to file "infocom" does not change
st_mtime, what is recorded as the stat information for the cache
entry "infocom" exactly matches what is on the filesystem
(owner, group, inum, mtime, ctime, mode, length).  After this
sequence, we incorrectly think "infocom" file still has string
"frotz" in it, and get really confused.  E.g. git-diff-files
would say there is no change, git-update-index --refresh would
not even look at the filesystem to correct the situation.

Some ways of working around this issue were already suggested by
Linus in the same thread on the same day, including waiting
until the next second before returning from update-index if a
cache entry written out has the current timestamp, but that
means we can make at most one commit per second, and given that
the e-mail patch workflow used by Linus needs to process at
least 5 commits per second, it is not an acceptable solution.
Linus notes that git-apply is primarily used to update the index
while processing e-mailed patches, which is true, and
git-apply's up-to-date check is fooled by the same problem but
luckily in the other direction, so it is not really a big issue,
but still it is disturbing.

The function ce_match_stat() is called to bypass the comparison
against filesystem data when the stat data recorded in the cache
entry matches what stat() returns from the filesystem.  This
patch tackles the problem by changing it to actually go to the
filesystem data for cache entries that have the same mtime as
the index file itself.  This works as long as the index file and
working tree files are on the filesystems that share the same
monotonic clock.  Files on network mounted filesystems sometimes
get skewed timestamps compared to "date" output, but as long as
working tree files' timestamps are skewed the same way as the
index file's, this approach still works.  The only problematic
files are the ones that have the same timestamp as the index
file's, because two file updates that sandwitch the index file
update must happen within the same second to trigger the
problem.

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Use git config file for committer name and email info</title>
<updated>2005-10-12T01:47:34Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@osdl.org</email>
</author>
<published>2005-10-12T01:47:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e1b10391eabdaaa4c89c53099dd96d5f9d978719'/>
<id>urn:sha1:e1b10391eabdaaa4c89c53099dd96d5f9d978719</id>
<content type='text'>
This starts using the "user.name" and "user.email" config variables if
they exist as the default name and email when committing.  This means
that you don't have to use the GIT_COMMITTER_EMAIL environment variable
to override your email - you can just edit the config file instead.

The patch looks bigger than it is because it makes the default name and
email information non-static and renames it appropriately.  And it moves
the common git environment variables into a new library file, so that
you can link against libgit.a and get the git environment without having
to link in zlib and libcrypt.

In short, most of it is renaming and moving, the real change core is
just a few new lines in "git_default_config()" that copies the user
config values to the new base.

It also changes "git-var -l" to list the config variables.

Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Use core.filemode.</title>
<updated>2005-10-12T01:45:33Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2005-10-12T01:45:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3e09cdfd114651fc61656dbd45d5ec3d9352cb2b'/>
<id>urn:sha1:3e09cdfd114651fc61656dbd45d5ec3d9352cb2b</id>
<content type='text'>
With "[core] filemode = false", you can tell git to ignore
differences in the working tree file only in executable bit.

 * "git-update-index --refresh" does not say "needs update" if index
   entry and working tree file differs only in executable bit.

 * "git-update-index" on an existing path takes executable bit
   from the existing index entry, if the path and index entry are
   both regular files.

 * "git-diff-files" and "git-diff-index" without --cached flag
   pretend the path on the filesystem has the same executable
   bit as the existing index entry, if the path and index entry
   are both regular files.

If you are on a filesystem with unreliable mode bits, you may need to
force the executable bit after registering the path in the index.

 * "git-update-index --chmod=+x foo" flips the executable bit of the
   index file entry for path "foo" on.  Use "--chmod=-x" to flip it
   off.

Note that --chmod only works in index file and does not look at nor
update the working tree.

So if you are on a filesystem and do not have working executable bit,
you would do:

 1. set the appropriate .git/config option;

 2. "git-update-index --add new-file.c"

 3. "git-ls-files --stage new-file.c" to see if it has the desired
   mode bits.  If not, e.g. to drop executable bit picked up from the
   filesystem, say "git-update-index --chmod=-x new-file.c".

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Add ".git/config" file parser</title>
<updated>2005-10-10T23:31:08Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@osdl.org</email>
</author>
<published>2005-10-10T23:31:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=17712991a59824a8d22d5115c0c154d3122fc17b'/>
<id>urn:sha1:17712991a59824a8d22d5115c0c154d3122fc17b</id>
<content type='text'>
This is a first cut at a very simple parser for a git config file.

The format of the file is a simple ini-file like thing, with simple
variable/value pairs. You can (and should) make the variables have a
simple single-level scope, ie a valid file looks something like this:

	#
	# This is the config file, and
	# a '#' or ';' character indicates
	# a comment
	#

	; core variables
	[core]
		; Don't trust file modes
		filemode = false

	; Our diff algorithm
	[diff]
		external = "/usr/local/bin/gnu-diff -u"
		renames = true

which parses into three variables: "core.filemode" is associated with the
string "false", and "diff.external" gets the appropriate quoted value.

Right now we only react to one variable: "core.filemode" is a boolean that
decides if we should care about the 0100 (user-execute) bit of the stat
information. Even that is just a parsing demonstration - this doesn't
actually implement that st_mode compare logic itself.

Different programs can react to different config options, although they
should always fall back to calling "git_default_config()" on any config
option name that they don't recognize.

Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>[PATCH] Better error reporting for "git status"</title>
<updated>2005-10-02T06:55:47Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@osdl.org</email>
</author>
<published>2005-10-01T20:24:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5d1a5c02e8ac1c16688ea4a44512245f25a49f8a'/>
<id>urn:sha1:5d1a5c02e8ac1c16688ea4a44512245f25a49f8a</id>
<content type='text'>
Instead of "git status" ignoring (and hiding) potential errors from the
"git-update-index" call, make it exit if it fails, and show the error.

In order to do this, use the "-q" flag (to ignore not-up-to-date files)
and add a new "--unmerged" flag that allows unmerged entries in the index
without any errors.

This also avoids marking the index "changed" if an entry isn't actually
modified, and makes sure that we exit with an understandable error message
if the index is corrupt or unreadable. "read_cache()" no longer returns an
error for the caller to check.

Finally, make die() and usage() exit with recognizable error codes, if we
ever want to check the failure reason in scripts.

Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Diff clean-up.</title>
<updated>2005-09-25T06:50:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2005-09-21T07:00:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6b5ee137e56af8093391411389dd4b18416707ec'/>
<id>urn:sha1:6b5ee137e56af8093391411389dd4b18416707ec</id>
<content type='text'>
This is a long overdue clean-up to the code for parsing and passing
diff options.  It also tightens some constness issues.

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Show modified files in git-ls-files</title>
<updated>2005-09-20T22:07:53Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2005-09-19T22:11:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b0391890d25d9e7ca8f7df2199292df68ead8093'/>
<id>urn:sha1:b0391890d25d9e7ca8f7df2199292df68ead8093</id>
<content type='text'>
Add -m/--modified to show files that have been modified wrt. the index.

[jc: The original came from Brian Gerst on Sep 1st but it only checked
if the paths were cache dirty without actually checking the files were
modified.  I also added the usage string and a new test.]

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>[PATCH] Fix buffer overflow in ce_flush().</title>
<updated>2005-09-11T17:51:13Z</updated>
<author>
<name>Qingning Huo</name>
<email>qhuo@mayhq.co.uk</email>
</author>
<published>2005-09-11T13:27:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2c865d9aa7b9c3511f901b2544b667c5188f510e'/>
<id>urn:sha1:2c865d9aa7b9c3511f901b2544b667c5188f510e</id>
<content type='text'>
Add a check before appending SHA1 signature to write_buffer,
flush it first if necessary.

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
</feed>
