git.git
19 years agogit-rev-list: use proper lazy reachability analysis
Linus Torvalds [Tue, 31 May 2005 01:46:32 +0000 (18:46 -0700)]
git-rev-list: use proper lazy reachability analysis

This mean sthat you can give a beginning/end pair to git-rev-list,
and it will show all entries that are reachable from the beginning
but not the end.

For example

git-rev-list v2.6.12-rc5 v2.6.12-rc4

shows all commits that are in -rc5 but are not in -rc4.

19 years agocommit_list_insert: return the new commit list entry
Linus Torvalds [Tue, 31 May 2005 01:44:02 +0000 (18:44 -0700)]
commit_list_insert: return the new commit list entry

This is useful for when we want to insert the next one after
this new one, for example.

19 years ago[PATCH] Show dissimilarity index for D and N case.
Junio C Hamano [Mon, 30 May 2005 23:40:16 +0000 (16:40 -0700)]
[PATCH] Show dissimilarity index for D and N case.

The way broken deletes and creates are shown in the -p
(diff-patch) output format has become consistent with how
rename/copy edits are shown.  They will show "dissimilarity
index" value, immediately following the "deleted file mode" and
"new file mode" lines.

The git-apply is taught to grok such an extended header.

Signed-off-by: Junio C Hamano <junkio@cox.net>
19 years ago[PATCH] Add -O<orderfile> option to diff-* brothers.
Junio C Hamano [Mon, 30 May 2005 07:09:07 +0000 (00:09 -0700)]
[PATCH] Add -O<orderfile> option to diff-* brothers.

A new diffcore filter diffcore-order is introduced.  This takes
a text file each of whose line is a shell glob pattern.  Patches
that match a glob pattern on an earlier line in the file are
output before patches that match a later line, and patches that
do not match any glob pattern are output last.

A typical orderfile for git project probably should look like
this:

    README
    Makefile
    Documentation
    *.h
    *.c

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Buglets fix in the new two scripts
Junio C Hamano [Mon, 30 May 2005 20:53:45 +0000 (13:53 -0700)]
[PATCH] Buglets fix in the new two scripts

Should be obvious...

 - Use $VISUAL, $EDITOR, in this order if set, and fall back on
   vi.

 - Status R, C, D, N usually are followed by number, so adjust
   case arms to that pattern.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agogit-resolve-script: use "git-apply --stat" instead of diffstat
Linus Torvalds [Tue, 31 May 2005 00:45:41 +0000 (17:45 -0700)]
git-resolve-script: use "git-apply --stat" instead of diffstat

Not everybody necessarily even has diffstat installed.

19 years ago[PATCH] mkdelta enhancements (take 2)
Nicolas Pitre [Mon, 30 May 2005 01:52:19 +0000 (21:52 -0400)]
[PATCH] mkdelta enhancements (take 2)

Although it was described as such, git-mkdelta didn't really attempt to
find the best delta against any previous object in the list, but was
only able to create a delta against the preceeding object.  This patch
reworks the code to fix that limitation and hopefully makes it a bit
clearer than before, including fixing the delta loop detection which was
broken.

This means that

git-mkdelta sha1 sha2 sha3 sha4 sha5 sha6

will now create a sha2 delta against sha1, a sha3 delta against either
sha2 or sha1 and keep the best one, a sha4 delta against either sha3,
sha2 or sha1, etc.  The --max-behind argument limits that search for the
best delta to the specified number of previous objects in the list.  If
no limit is specified it is unlimited (note: it might run out of
memory with long object lists).

Also added a -q (quiet) switch so it is possible to have 3 levels of
output: -q for nothing, -v for verbose, and if none of -q nor -v is
specified then only actual changes on the object database are shown.

Finally the git-deltafy-script has been updated accordingly, and some
bugs fixed (thanks to Stephen C. Tweedie for spotting them).

This version has been toroughly tested and I think it is ready
for public consumption.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agoAdd "commit" helper script
Linus Torvalds [Mon, 30 May 2005 19:51:00 +0000 (12:51 -0700)]
Add "commit" helper script

This is meant to make raw git not hugely less usable than something
like raw CVS. I want to make a 1.0 release of the plumbing, and the
actual commit part was just too intimidating.

19 years ago[PATCH] Add -B flag to diff-* brothers.
Junio C Hamano [Mon, 30 May 2005 07:08:37 +0000 (00:08 -0700)]
[PATCH] Add -B flag to diff-* brothers.

A new diffcore transformation, diffcore-break.c, is introduced.

When the -B flag is given, a patch that represents a complete
rewrite is broken into a deletion followed by a creation.  This
makes it easier to review such a complete rewrite patch.

The -B flag takes the same syntax as the -M and -C flags to
specify the minimum amount of non-source material the resulting
file needs to have to be considered a complete rewrite, and
defaults to 99% if not specified.

As the new test t4008-diff-break-rewrite.sh demonstrates, if a
file is a complete rewrite, it is broken into a delete/create
pair, which can further be subjected to the usual rename
detection if -M or -C is used.  For example, if file0 gets
completely rewritten to make it as if it were rather based on
file1 which itself disappeared, the following happens:

    The original change looks like this:

file0     --> file0' (quite different from file0)
file1     --> /dev/null

    After diffcore-break runs, it would become this:

file0     --> /dev/null
/dev/null --> file0'
file1     --> /dev/null

    Then diffcore-rename matches them up:

file1     --> file0'

The internal score values are finer grained now.  Earlier
maximum of 10000 has been raised to 60000; there is no user
visible changes but there is no reason to waste available bits.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] diff: fix the culling of unneeded delete record.
Junio C Hamano [Mon, 30 May 2005 07:08:07 +0000 (00:08 -0700)]
[PATCH] diff: fix the culling of unneeded delete record.

The commit 15d061b435a7e3b6bead39df3889f4af78c4b00a

    [PATCH] Fix the way diffcore-rename records unremoved source.

still leaves unneeded delete records in its output stream by
mistake, which was covered up by having an extra check to turn
such a delete into a no-op downstream.  Fix the check in the
diffcore-rename to simplify the output routine.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] diff: further cleanup.
Junio C Hamano [Mon, 30 May 2005 07:07:39 +0000 (00:07 -0700)]
[PATCH] diff: further cleanup.

When preparing data to feed the external diff, we should give
the mode we obtained from the caller, even when we are dealing
with a file with 0{40} SHA1 (i.e. the caller said "look at the
filesystem"), since the mode passed by the caller via
diff_addremove() or diff_change() is always trustworthy.

This is _not_ a bugfix --- the existing code stat() on the file
ifself and does the same computation on st.st_mode to compute
the mode the same way the caller did to give the original mode.
We cannot remove the stat() call from here, but the extra
computation to create the mode value is unnecessary.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] diff: code clean-up and removal of rename hack.
Junio C Hamano [Sun, 29 May 2005 23:56:48 +0000 (16:56 -0700)]
[PATCH] diff: code clean-up and removal of rename hack.

A new macro, DIFF_PAIR_RENAME(), is introduced to distinguish a
filepair that is a rename/copy (the definition of which is src
and dst are different paths, of course).  This removes the hack
used in the record_rename_pair() to always put a non-zero value
in the score field.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] diff: consolidate various calls into diffcore.
Junio C Hamano [Sun, 29 May 2005 23:56:13 +0000 (16:56 -0700)]
[PATCH] diff: consolidate various calls into diffcore.

The three diff-* brothers had a sequence of calls into diffcore
that were almost identical.  Introduce a new diffcore_std()
function that takes all the necessary arguments to consolidate
it.  This will make later enhancements and changing the order of
diffcore application simpler.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] diff-helper: Fix R/C score parsing under -z flag.
Junio C Hamano [Sun, 29 May 2005 23:54:59 +0000 (16:54 -0700)]
[PATCH] diff-helper: Fix R/C score parsing under -z flag.

The score number that follow R/C status were parsed but the
parse pointer was not updated, causing the entire line to become
unrecognized.  This patch fixes this problem.

There was a test missing to catch this breakage, which this
commit adds as t4009-diff-rename-4.sh.  The diff-raw tests used
in related t4005-diff-rename-2.sh (the same test without -z) and
t4007-rename-3.sh were stricter than necessarily, despite that
the comment for the tests said otherwise.  This patch also
corrects them.

The documentation is updated to say that the status can
optionally be followed by a number called "score"; it does not
have to stay similarity index forever and there is no reason to
limit it only to C and R.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agogit-init-db: set up the full default environment
Linus Torvalds [Mon, 30 May 2005 17:20:44 +0000 (10:20 -0700)]
git-init-db: set up the full default environment

Create .git/refs/{heads,tags} and make .git/HEAD be a symlink to
(the as yet non-existent) .git/refs/heads/master.

19 years agogit-mktag: be more careful in reading the input.
Linus Torvalds [Sun, 29 May 2005 19:06:32 +0000 (12:06 -0700)]
git-mktag: be more careful in reading the input.

Instead of always assuming it can be read with a single
read() system call, loop around properly.

Pointed out by Pasky, but I ended up implementing it differently
from his suggested patch.

19 years ago[PATCH] Fix count-delta overcounting
Junio C Hamano [Sat, 28 May 2005 19:22:38 +0000 (12:22 -0700)]
[PATCH] Fix count-delta overcounting

The count-delta routine sometimes overcounted the copied source
material which resulted in unsigned int wraparound.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Do not include unused header files.
Junio C Hamano [Sat, 28 May 2005 09:55:16 +0000 (02:55 -0700)]
[PATCH] Do not include unused header files.

Some source files were including "delta.h" without actually
needing it.  Remove them.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Pickaxe fixes.
Junio C Hamano [Sat, 28 May 2005 09:53:43 +0000 (02:53 -0700)]
[PATCH] Pickaxe fixes.

A bug in the command line argument parsing code was making
pickaxe not to work at all in diff-cache and diff-files commands.
Embarrassingly enough, the working pickaxe in diff-tree tells me
that it was not working in these two commands from day one.
This patch fixes it.

Also updates the documentation to describe the --pickaxe-all option.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Rewrite ls-tree to behave more like "/bin/ls -a"
Junio C Hamano [Sat, 28 May 2005 07:05:38 +0000 (00:05 -0700)]
[PATCH] Rewrite ls-tree to behave more like "/bin/ls -a"

This is a complete rewrite of ls-tree to make it behave more
like what "/bin/ls -a" does in the current working directory.

Namely, the changes are:

 - Unlike the old ls-tree behaviour that used paths arguments to
   restrict output (not that it worked as intended---as pointed
   out in the mailing list discussion, it was quite incoherent),
   this rewrite uses paths arguments to specify what to show.

 - Without arguments, it implicitly uses the root level as its
   sole argument ("/bin/ls -a" behaves as if "." is given
   without argument).

 - Without -r (recursive) flag, it shows the named blob (either
   file or symlink), or the named tree and its immediate
   children.

 - With -r flag, it shows the named path, and recursively
   descends into it if it is a tree.

 - With -d flag, it shows the named path and does not show its
   children even if the path is a tree, nor descends into it
   recursively.

This is still request-for-comments patch.  There is no mailing
list consensus that this proposed new behaviour is a good one.

The patch to t/t3100-ls-tree-restrict.sh illustrates
user-visible behaviour changes.  Namely:

 * "git-ls-tree $tree path1 path0" lists path1 first and then
   path0.  It used to use paths as an output restrictor and
   showed output in cache entry order (i.e. path0 first and then
   path1) regardless of the order of paths arguments.

 * "git-ls-tree $tree path2" lists path2 and its immediate
   children but having explicit paths argument does not imply
   recursive behaviour anymore, hence paths/baz is shown but not
   paths/baz/b.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Adjust diff-helper to diff-tree -v -z changes.
Junio C Hamano [Sat, 28 May 2005 04:05:38 +0000 (21:05 -0700)]
[PATCH] Adjust diff-helper to diff-tree -v -z changes.

The latest change to diff-tree -z output adds an extra line
termination after non diff-raw material (the header and the
commit message).  To compensate for this change, stop adding the
output termination of our own.  "diff-tree -v -z" piped to
"diff-helper -z" would give different result from "diff-tree -v"
piped to "diff-helper" without this change.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Optimize diff-tree -[CM] --stdin
Junio C Hamano [Fri, 27 May 2005 22:56:38 +0000 (15:56 -0700)]
[PATCH] Optimize diff-tree -[CM] --stdin

This attempts to optimize "diff-tree -[CM] --stdin", which
compares successible tree pairs.  This optimization does not
make much sense for other commands in the diff-* brothers.

When reading from --stdin and using rename/copy detection, the
patch makes diff-tree to read the current index file first.
This is done to reuse the optimization used by diff-cache in the
non-cached case.  Similarity estimator can avoid expanding a
blob if the index says what is in the work tree has an exact
copy of that blob already expanded.

Another optimization the patch makes is to check only file sizes
first to terminate similarity estimation early.  In order for
this to work, it needs a way to tell the size of the blob
without expanding it.  Since an obvious way of doing it, which
is to keep all the blobs previously used in the memory, is too
costly, it does so by keeping the filesize for each object it
has already seen in memory.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Move pathspec to the beginning of the diffcore chain.
Junio C Hamano [Fri, 27 May 2005 22:56:17 +0000 (15:56 -0700)]
[PATCH] Move pathspec to the beginning of the diffcore chain.

This changes the way how pathspec is used in the three diff-*
brothers.  Earlier, they tried to grab as much information from
the original input and used pathspec to limit the output.  This
version uses pathspec upfront to narrow the world diffcore
operates in, so "git-diff-* <arguments> some-directory" does not
look at things outside the specified subtree when finding
rename/copy or running pickaxe.

Since diff-tree already takes this view and does not feed
anything outside the specified directotires to begin with, this
patch does not have to touch that command.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Fix the way diffcore-rename records unremoved source.
Junio C Hamano [Fri, 27 May 2005 22:55:55 +0000 (15:55 -0700)]
[PATCH] Fix the way diffcore-rename records unremoved source.

Earier version of diffcore-rename used to keep unmodified
filepair in its output so that the last stage of the processing
that tells renames from copies can make all of rename/copy to
copies.  However this had a bad interaction with other diffcore
filters that wanted to run after diffcore-rename, in that such
unmodified filepair must be retained for proper distinction
between renames and copies to happen.

This patch fixes the problem by changing the way diffcore-rename
records the information needed to distinguish "all are copies"
case and "the last one is a rename" case.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Add --pickaxe-all to diff-* brothers.
Junio C Hamano [Fri, 27 May 2005 22:55:28 +0000 (15:55 -0700)]
[PATCH] Add --pickaxe-all to diff-* brothers.

When --pickaxe-all is given in addition to -S, pickaxe shows the
entire diffs contained in the changeset, not just the diffs for
the filepair that touched the sought-after string.  This is
useful to see the changes in context.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Remove a function not used anymore.
Junio C Hamano [Fri, 27 May 2005 22:55:01 +0000 (15:55 -0700)]
[PATCH] Remove a function not used anymore.

Earlier rename/copy detection left unmodified filepair in the
output and forced downstream to keep them even when they are
filtering, and the diff_needs_to_stay() function was used for
the logic.  It is not used anymore, so remove it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Clean up diff_setup() to make it more extensible.
Junio C Hamano [Fri, 27 May 2005 22:54:37 +0000 (15:54 -0700)]
[PATCH] Clean up diff_setup() to make it more extensible.

This changes the argument of diff_setup() from an integer that
says if we are feeding reversed diff to a bitmask, so that later
global options can be added more easily.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Remove final newline from the value of xfrm_msg variable.
Junio C Hamano [Fri, 27 May 2005 22:54:06 +0000 (15:54 -0700)]
[PATCH] Remove final newline from the value of xfrm_msg variable.

This change makes the implementation of git-external-diff-script
cleaner.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Do not expose internal scaling to diff-helper.
Junio C Hamano [Fri, 27 May 2005 22:53:31 +0000 (15:53 -0700)]
[PATCH] Do not expose internal scaling to diff-helper.

Instead we can normalize what diff-raw records at the diffcore
side.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Remove unused rank field from diff_core structure.
Junio C Hamano [Fri, 27 May 2005 22:52:55 +0000 (15:52 -0700)]
[PATCH] Remove unused rank field from diff_core structure.

This removes a field that is no longer used from diff_score
structure.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Make pathspec only care about the detination tree.
Junio C Hamano [Fri, 27 May 2005 22:51:52 +0000 (15:51 -0700)]
[PATCH] Make pathspec only care about the detination tree.

Earlier it had a misguided attempt to include paths that matches
either source tree or destination tree after the rename/copy
detection.  The new semantics will be that pathspec defines a
narrowed down world the diffcore operates in, so it should not
even look at where in the source tree the path came from.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Introduce diff_free_filepair() funcion.
Junio C Hamano [Fri, 27 May 2005 22:50:30 +0000 (15:50 -0700)]
[PATCH] Introduce diff_free_filepair() funcion.

This introduces a new function to free a common data structure,
and plugs some leaks.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Fix math thinko in similarity estimator.
Junio C Hamano [Fri, 27 May 2005 22:49:54 +0000 (15:49 -0700)]
[PATCH] Fix math thinko in similarity estimator.

The math to reject delta that is too big was confused.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Document the --root switch of git-diff-tree
Thomas Glanzmann [Sat, 28 May 2005 14:42:17 +0000 (16:42 +0200)]
[PATCH] Document the --root switch of git-diff-tree

Signed-off-by: Thomas Glanzmann <sithglan@stud.uni-erlangen.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] check_file_directory_conflict path fix
David Meybohm [Fri, 27 May 2005 02:59:10 +0000 (22:59 -0400)]
[PATCH] check_file_directory_conflict path fix

check_file_directory_conflict can give the wrong answers. This is
because the wrong length is passed to cache_name_pos. The length
passed should be the length of the whole path from the root, not
the length of each path subcomponent.

$ git-init-db
defaulting to local storage area
$ mkdir path && touch path/file
$ git-update-cache --add path/file
$ rm path/file
$ mkdir path/file && touch path/file/f
$ git-update-cache --add path/file/f  <-- Conflict ignored
$

Signed-off-by: David Meybohm <dmeybohmlkml@bellsouth.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agogit-diff-tree: simplify header output with '-z'
Linus Torvalds [Fri, 27 May 2005 17:22:09 +0000 (10:22 -0700)]
git-diff-tree: simplify header output with '-z'

No need to make them multiple lines, in fact we explicitly don't want that.

This also fixes a 64-bit problem pointed out by Markus F.X.J. Oberhumer,
where we gave "%.*s" a "ptrdiff_t" length argument instead of an "int".

19 years ago[PATCH] allow pathspec to end with a slash
Junio C Hamano [Fri, 27 May 2005 00:52:43 +0000 (17:52 -0700)]
[PATCH] allow pathspec to end with a slash

The recent rewrite broke "git-whatchanged -v -p drivers/usb/" but
"git-whatchanged -v -p drivers/usb" still works.  Just strip out the
trailing slashes internally to make it work again.

It uses compare-thing-with-number comparison order instead of visual
comparison order ;-).

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agogit-diff-tree: don't use diffcore_pathspec()
Linus Torvalds [Fri, 27 May 2005 00:41:28 +0000 (17:41 -0700)]
git-diff-tree: don't use diffcore_pathspec()

diff-tree does the culling of uninteresting paths internally, and
fundamentally has to do so for performance reasons. So there's no
point in calling the separate pathname culling logic here,
especially as it seems slightly broken.

19 years ago[PATCH] fix and testcase for git-commit-tree option
Rene Scharfe [Thu, 26 May 2005 23:03:26 +0000 (01:03 +0200)]
[PATCH] fix and testcase for git-commit-tree option

Actually use GIT_COMMITTER_DATE in git-commit-tree.

(It used to mistakenly re-use the author date)

Add test-case for it.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Make ls-* output consistent with diff-* output format.
Junio C Hamano [Thu, 26 May 2005 21:38:19 +0000 (14:38 -0700)]
[PATCH] Make ls-* output consistent with diff-* output format.

Use SP as the column separator except the ones before path which
uses TAB, to make the output format consistent across ls-* and
diff-* commands.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] ls-tree matching multiple paths
Jason McMullan [Thu, 26 May 2005 17:52:50 +0000 (10:52 -0700)]
[PATCH] ls-tree matching multiple paths

Enhance git-ls-tree to allow optional 'match paths' that
restricts the output of git-ls-tree.  This is useful to retrieve
a single file's SHA1 out of a tree without creating an index.

[JC: I added the test case]

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Add git-external-diff-script
Junio C Hamano [Thu, 26 May 2005 09:31:05 +0000 (02:31 -0700)]
[PATCH] Add git-external-diff-script

This is a demonstration of GIT_EXTERNAL_DIFF mechanism, and a
testbed for tweaking and enhancing what the built-in diff should
do.  This script is designed to output exactly the same output
as what the built-in diff driver produces when used as the
GIT_EXTERNAL_DIFF command.

I've run this and updated built-in diff on the entire history of
linux-2.6 git repository, and JG's udev.git repository which has
interesting symlink cases to make sure it is equivalent to the
built-in diff driver.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Diff updates to express type changes
Junio C Hamano [Thu, 26 May 2005 09:24:30 +0000 (02:24 -0700)]
[PATCH] Diff updates to express type changes

With the introduction of type 'T' in the diff-raw output, and
the "apply-patch" program Linus has been quietly working on
without much advertisement, it started to make sense to emit
usable information in the "diff --git" patch output format as
well.  Earlier built-in diff driver punted and did not say
anything about a symbolic link changing into a file or vice
versa, but this version represents it as a pair of deletion
and creation.

It also fixes a minor problem dealing with old archive created
with ancient git.  The earlier code was reporting file mode
change between 100664 and 100644 (we shouldn't).  The linux-2.6
git tree has a good example that exposes this problem.  A good
test case is commit ce1dc02f76432a46db149241e015a4f782974623.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agogit-apply: add "--check" option to check that the diff makes sense
Linus Torvalds [Thu, 26 May 2005 22:10:02 +0000 (15:10 -0700)]
git-apply: add "--check" option to check that the diff makes sense

It currently only verifies the index against the working directory,
it doesn't actually verify the diff fragments themselves yet.

19 years agogit-apply: when validating default names, check the final EOLN too
Linus Torvalds [Thu, 26 May 2005 20:28:42 +0000 (13:28 -0700)]
git-apply: when validating default names, check the final EOLN too

This means that filenames are totally unambiguous even if they
have spaces or tabs in them.

19 years agogit-apply: pick up default filenames from "diff --git" header line
Linus Torvalds [Thu, 26 May 2005 20:11:24 +0000 (13:11 -0700)]
git-apply: pick up default filenames from "diff --git" header line

Pure mode changes, and deletes or creates of empty files won't have this
information anywhere else.

19 years agogit-apply: make the diffstat output happen for "--stat" only.
Linus Torvalds [Thu, 26 May 2005 19:25:52 +0000 (12:25 -0700)]
git-apply: make the diffstat output happen for "--stat" only.

Slowly this is takign the form of a program that we'd actually
use. Now "git-apply --stat" basically ends up being a perfectly
useful diffstat.

19 years agogit-apply: implement "diffstat" output
Linus Torvalds [Thu, 26 May 2005 18:40:43 +0000 (11:40 -0700)]
git-apply: implement "diffstat" output

Hey, it's almost free by now, and it's a good way to see that
we parse the patches correctly.

19 years agogit-apply: parse the whole list of patches into memory first
Linus Torvalds [Thu, 26 May 2005 17:23:51 +0000 (10:23 -0700)]
git-apply: parse the whole list of patches into memory first

Make it a clear two-phase thing: first a read-only parse of
the patch itself (which is independent of any current index
information), and then the second phase actually uses the patch.

The second phase might not be a real apply, it could be just a
diffstat, for example. Which is trivial to do once the patch is
parsed.

19 years ago[PATCH] Test case portability fix.
Mark Allen [Thu, 26 May 2005 02:11:31 +0000 (19:11 -0700)]
[PATCH] Test case portability fix.

This is the remainder of testcase fix by Mark Allen to make them
work on his Darwin box.  I was using "xargs -r" (GNU) where it
was not needed, sed -ne '/^\(author\|committer\)/s|>.*|>|p'
where some sed does not know what to do with '\|', and also
"cmp - file" to compare standard input with a file, which his
cmp does not support.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agoMake "parse_object()" also fill in commit message buffer data.
Linus Torvalds [Thu, 26 May 2005 02:26:28 +0000 (19:26 -0700)]
Make "parse_object()" also fill in commit message buffer data.

And teach fsck to free it to save memory.

19 years agogit-rev-list: add "end" commit and "--header" flag
Linus Torvalds [Thu, 26 May 2005 01:29:09 +0000 (18:29 -0700)]
git-rev-list: add "end" commit and "--header" flag

The "end" commit is just faking it right now, it's sorting things
purely by date, so this is _not_ a reachability analysis. Some day.

The "--header" flag causes the commit message to be printed out,
with a NUL character separator after it for parseability. This
allows you to do things like use "grep -z" to grep for certain
authors etc.

19 years agocommit: save the commit buffer off when parsing a commit
Linus Torvalds [Thu, 26 May 2005 01:27:14 +0000 (18:27 -0700)]
commit: save the commit buffer off when parsing a commit
object.

A fair number of the users potentially want to look at the
commit objects more closely, and if you worry about memory
leaking in certain applications, you can always do a

free(commit->buffer);
commit->buffer = NULL;

by hand after parsing them.

19 years agounpack_sha1_file: zero-pad the unpacked object.
Linus Torvalds [Thu, 26 May 2005 01:25:08 +0000 (18:25 -0700)]
unpack_sha1_file: zero-pad the unpacked object.

This makes them easier to parse without having to worry about
running off the end, and allows us to treat commits as normal
strings.

19 years ago[PATCH] Mode only changes from diff.
Junio C Hamano [Wed, 25 May 2005 23:00:04 +0000 (16:00 -0700)]
[PATCH] Mode only changes from diff.

This fixes another bug.

 - Mode-only changes were pruned incorrectly from the output.
 - Added test to catch the above problem.
 - Normalize rename/copy similarity score in the diff-raw output
   to per-cent, no matter what scale we internally use.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Fix type-change handling when assigning the status code to filepairs.
Junio C Hamano [Wed, 25 May 2005 22:07:08 +0000 (15:07 -0700)]
[PATCH] Fix type-change handling when assigning the status code to filepairs.

The interim single-liner '?' fix resulted delete entries that
should not have emitted coming out in the output as an
unintended side effect; I caught this with the "rename" test in
the test suite.  This patch instead fixes the code that assigns
the status code to each filepair.

I verified this does not break the testcase in udev.git tree Kay
Sievers gave us, by running git-diff-tree on that tree which
showed 21 file to symlink changes.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Adjust show-files test for dotfiles.
Junio C Hamano [Wed, 25 May 2005 22:06:50 +0000 (15:06 -0700)]
[PATCH] Adjust show-files test for dotfiles.

The earlier test was relying on the fact that dotfiles do not
appear in the output to prepare expected test results, which
inevitably got broken when we started handling dotfiles.  Change
the test to be honest about what "--other" file it creates.

The problem was originally pointed out by Mark Allen.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agogit-pull-script: pretty-print the merge head information
Linus Torvalds [Wed, 25 May 2005 21:05:13 +0000 (14:05 -0700)]
git-pull-script: pretty-print the merge head information

This also drops the common ".git" part from the end of the repo
name, and if a non-default head reference is given, makes a nicer
commit message about it.

19 years ago[PATCH] optimize git-resolve-script
Jeff Garzik [Wed, 25 May 2005 17:21:09 +0000 (13:21 -0400)]
[PATCH] optimize git-resolve-script

This change was suggested for my git-switch-tree script, and the same
issues apply to core git's git-resolve-script as well.

19 years agodiff.c: don't silently ignore unknown state changes in diffs.
Linus Torvalds [Wed, 25 May 2005 18:09:12 +0000 (11:09 -0700)]
diff.c: don't silently ignore unknown state changes in diffs.

Give them an "unknown" status, ie '?'.

19 years ago[PATCH] show changed tree objects with recursive git-diff-tree
Junio C Hamano [Wed, 25 May 2005 06:24:22 +0000 (23:24 -0700)]
[PATCH] show changed tree objects with recursive git-diff-tree

This adds a "-t" flag to tell the raw diff output to include the tree
objects in the output when doing a recursive diff.

Since that's how the non-recursive output already handles trees and the
flag thus doesn't make sense without "-r", I made "-t" imply "-r".

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Use pathspec array correctly
Junio C Hamano [Wed, 25 May 2005 06:35:38 +0000 (23:35 -0700)]
[PATCH] Use pathspec array correctly

Oh, I am an idiot.  Repeating the same check against the first
element of pathspec array as many times as the pathspec array
has elements in it would not do us any good.

This patch allows you to specify more than one pathspec to
diff-tree family and have them actually used.

Signed-off-by: Junio C Hamano <junkio@cox.net>
;)
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agogit-rev-tree: teach it about tag references
Linus Torvalds [Wed, 25 May 2005 04:34:12 +0000 (21:34 -0700)]
git-rev-tree: teach it about tag references

And various cleanups that makes it able to not care.

19 years ago[PATCH] Allow dot files in ls-files as well (take #2).
Junio C Hamano [Wed, 25 May 2005 01:20:08 +0000 (18:20 -0700)]
[PATCH] Allow dot files in ls-files as well (take #2).

This attempts to match "the directory '.git' anywhere in the
tree is ignored" approach taken in update-cache.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agogit-diff-cache: fix argument parsing
Linus Torvalds [Wed, 25 May 2005 01:10:11 +0000 (18:10 -0700)]
git-diff-cache: fix argument parsing

And make the code more readable while at it.

19 years ago[PATCH] Update rename/copy similarity estimator.
Junio C Hamano [Tue, 24 May 2005 19:09:32 +0000 (12:09 -0700)]
[PATCH] Update rename/copy similarity estimator.

The second round similarity estimator simply used the size of
the xdelta itself to estimate the extent of damage.  This patch
keeps that logic to detect big insertions to terminate the check
early, but otherwise looks at the generated delta in order to
estimate the extent of edit more accurately.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Squelch compiler warning
Junio C Hamano [Tue, 24 May 2005 18:57:01 +0000 (11:57 -0700)]
[PATCH] Squelch compiler warning

Not important but I am a bit annoyed by gcc complaining about the
control falling out of the function without returning value.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Allow symlinks in the leading path in checkout-cache --prefix=
Junio C Hamano [Tue, 24 May 2005 08:51:27 +0000 (01:51 -0700)]
[PATCH] Allow symlinks in the leading path in checkout-cache --prefix=

This is what Linus wrote, improving what David Greaves
originally submitted.

I just added a test case and verified the patch works.

Author: David Greaves <david@dgreaves.com>
Author: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Use DIFF_FORMAT_NO_OUTPUT to implement diff-tree -s option.
Junio C Hamano [Tue, 24 May 2005 09:05:08 +0000 (02:05 -0700)]
[PATCH] Use DIFF_FORMAT_NO_OUTPUT to implement diff-tree -s option.

Instead of checking silent flag all over the place, simply use
the NO_OUTPUT option diffcore provides to suppress the diff
output.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agogit-update-cache: allow dot-files
Linus Torvalds [Tue, 24 May 2005 21:40:28 +0000 (14:40 -0700)]
git-update-cache: allow dot-files

We still refuse to add ".", ".." and ".git".

In theory, you could track another git-repository by allowing ".git",
but the potential for confusion is just too high.

19 years agocvs2git: fix character quoting
Linus Torvalds [Tue, 24 May 2005 19:57:12 +0000 (12:57 -0700)]
cvs2git: fix character quoting

We need to quote backslash and backtick too.

And inform the user about our progress, since converting a
big archive can take time. Doing the full mutt history took
just under eight minutes.

19 years agogit-commit-tree: allow overriding of commit date
Linus Torvalds [Tue, 24 May 2005 17:21:13 +0000 (10:21 -0700)]
git-commit-tree: allow overriding of commit date

Using GIT_COMMITTER_DATE, of course..

19 years agocvs2git: set timezone info to UTC, the way CVS does
Linus Torvalds [Tue, 24 May 2005 17:15:42 +0000 (10:15 -0700)]
cvs2git: set timezone info to UTC, the way CVS does

This should also mean that the conversion is now completely
defined by the CVS tree, and that two people doing a cvs2git
conversion on the same base will always get the same results
regardless of when or in what timezone they do it.

19 years agocvs2git: add support for GIT_COMMITTER_DATE
Linus Torvalds [Tue, 24 May 2005 16:59:55 +0000 (09:59 -0700)]
cvs2git: add support for GIT_COMMITTER_DATE

Of course, this requires a version of git that cares..

19 years agocvs2git: escape <<EOF messages, and work around cvsps branch handling
Linus Torvalds [Tue, 24 May 2005 16:36:33 +0000 (09:36 -0700)]
cvs2git: escape <<EOF messages, and work around cvsps branch handling

This escapes '$' characters in <<-handling, and gives preference to
the new branch when cvsps incorrectly reports a commit as originating
on an old branch.

19 years agoFix cvs2git branch handling
Linus Torvalds [Tue, 24 May 2005 16:06:51 +0000 (09:06 -0700)]
Fix cvs2git branch handling

.. and tell 'co' to shut up about the rcs noise.

This still leaves some branch issues up in the air: it looks like
cvsps has some questionable originating branch information, but I
don't know whether that's a cvsps bug or an actual bug in the
syslinux archive I'm using to test.

I'll let David Mansfield answer my questions about CVS. I'm a
total idiot when it comes to branches under CVS ("I'm pure!").

19 years ago[PATCH] Redo rename/copy detection logic.
Junio C Hamano [Tue, 24 May 2005 08:10:48 +0000 (01:10 -0700)]
[PATCH] Redo rename/copy detection logic.

Earlier implementation had a major screw-up in the memory
management area.  Rename/copy logic sometimes borrowed a pointer
to a structure without any provision for downstream to determine
which pointer is shared and which is not.  This resulted in the
later clean-up code to sometimes double free such structure,
resulting in a segfault.  This made -M and -C useless.

Another problem the earlier implementation had was that it
reordered the patches, and forced the logic to differentiate
renames and copies to depend on that particular order.  This
problem was fixed by teaching rename/copy detection logic not to
do any reordering, and rename-copy differentiator not to depend
on the order of the patches.  The diffs will leave rename/copy
detector in the same destination path order as the patch that
was fed into it.  Some test vectors have been reordered to
accommodate this change.

It also adds a sanity check logic to the human-readable diff-raw
output to detect paths with embedded TAB and LF characters,
which cannot be expressed with that format.  This idea came up
during a discussion with Chris Wedgwood.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agoAdd "cvs2git" program to convert a CVS archive into a GIT archive
Linus Torvalds [Tue, 24 May 2005 08:07:31 +0000 (01:07 -0700)]
Add "cvs2git" program to convert a CVS archive into a GIT archive

It's very hacky, and it needs lots of work, but it seems to have converted
Peter's "syslinux" archive successfully. Whether the end result is correct
or not is to be seen.

Tons of work still to do: do name conversion properly, and do tags etc.

And testing. Lots of testing.

19 years agogit-apply: more consistency checks on gitdiff filenames
Linus Torvalds [Tue, 24 May 2005 02:54:55 +0000 (19:54 -0700)]
git-apply: more consistency checks on gitdiff filenames

There's some duplication of filenames when doing filename operations
(creates, deletes, renames and copies), and this makes us verify that
the pathnames match when they should.

19 years ago[PATCH] adjust git-deltafy-script to the new diff-tree output format
Nicolas Pitre [Tue, 24 May 2005 01:58:00 +0000 (21:58 -0400)]
[PATCH] adjust git-deltafy-script to the new diff-tree output format

Also prevent 'sort' from sorting on the sha1 which was screwing the
history listing.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Update git-diff-cache documentation.
Junio C Hamano [Tue, 24 May 2005 01:20:39 +0000 (18:20 -0700)]
[PATCH] Update git-diff-cache documentation.

The recent diff updates gave diff-cache the same ability to
filter paths, which was not properly documented.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Fix diff-pruning logic which was running prune too early.
Junio C Hamano [Tue, 24 May 2005 01:14:03 +0000 (18:14 -0700)]
[PATCH] Fix diff-pruning logic which was running prune too early.

For later stages to reorder patches, pruning logic and rename detection
logic should not decide which delete to discard (because another entry
said it will take over the file as a rename) until the very end.

Also fix some tests that were assuming the earlier "last one is rename
or keep everything else is copy" semantics of diff-raw format, which no
longer is true.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agogit-apply: start using the index file information.
Linus Torvalds [Tue, 24 May 2005 02:13:55 +0000 (19:13 -0700)]
git-apply: start using the index file information.

Right now we only use it to figure out what the filename might
be when that is ambiguous, but we'll get there..

19 years agogit-apply: if no input files specified, apply stdin
Linus Torvalds [Mon, 23 May 2005 23:42:21 +0000 (16:42 -0700)]
git-apply: if no input files specified, apply stdin

This makes it act more like a traditional UNIX thing (eg "cat").

19 years agodiff-tree: don't write headers if the diff queue is empty
Linus Torvalds [Mon, 23 May 2005 23:37:47 +0000 (16:37 -0700)]
diff-tree: don't write headers if the diff queue is empty

This is not a pickaxe-specific thing, we do this regardless of
what has pruned down the diff queue.

19 years agogit-apply: unknown modes are zero, not -1
Linus Torvalds [Mon, 23 May 2005 23:32:19 +0000 (16:32 -0700)]
git-apply: unknown modes are zero, not -1

19 years ago[PATCH] diff-raw format update take #2.
Junio C Hamano [Mon, 23 May 2005 21:55:33 +0000 (14:55 -0700)]
[PATCH] diff-raw format update take #2.

This changes the diff-raw format again, following the mailing
list discussion.  The new format explicitly expresses which one
is a rename and which one is a copy.

The documentation and tests are updated to match this change.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agogit-apply: parse the diff headers (both traditional and new)
Linus Torvalds [Mon, 23 May 2005 23:09:09 +0000 (16:09 -0700)]
git-apply: parse the diff headers (both traditional and new)

.. and print out the information. This sets up all the pathname
information, and whether it's a new file, deleted file, rename,
copy or whatever.

It's slowly getting to the point where it all comes together,
and we can actually apply all the information that we've gathered.

19 years agogit-apply: improve error detection and messages
Linus Torvalds [Mon, 23 May 2005 21:38:49 +0000 (14:38 -0700)]
git-apply: improve error detection and messages

In particular, give line numbers when detecting corrupt patches.
This makes the tool a lot more friendly (indeed, much more so
than regular "patch", I think).

19 years agogit-apply: bad patch fragments are fatal
Linus Torvalds [Mon, 23 May 2005 19:31:59 +0000 (12:31 -0700)]
git-apply: bad patch fragments are fatal

Don't just stop at them and look for the next header. Die,
die, die!

19 years ago[PATCH] NUL terminate diff-tree header lines under -z.
Junio C Hamano [Mon, 23 May 2005 19:07:55 +0000 (12:07 -0700)]
[PATCH] NUL terminate diff-tree header lines under -z.

Thomas Glanzmann noticed that diff-tree -z HEAD piped to
diff-helper -z did not work.  Since diff-helper -z expects NUL
terminated lines, we should generate such.

The output side of the diff-helper should always be using '\n'
termination; earlier it used the same line_termination used for
the input side, which was a mistake.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Performance fix for pickaxe.
Junio C Hamano [Mon, 23 May 2005 07:25:15 +0000 (00:25 -0700)]
[PATCH] Performance fix for pickaxe.

The pickaxe was expanding the blobs and searching in them even
when it should have already known that both sides are the same.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Rename/copy detection fix.
Junio C Hamano [Mon, 23 May 2005 04:26:09 +0000 (21:26 -0700)]
[PATCH] Rename/copy detection fix.

The rename/copy detection logic in earlier round was only good
enough to show patch output and discussion on the mailing list
about the diff-raw format updates revealed many problems with
it.  This patch fixes all the ones known to me, without making
things I want to do later impossible, mostly related to patch
reordering.

 (1) Earlier rename/copy detector determined which one is rename
     and which one is copy too early, which made it impossible
     to later introduce diffcore transformers to reorder
     patches.  This patch fixes it by moving that logic to the
     very end of the processing.

 (2) Earlier output routine diff_flush() was pruning all the
     "no-change" entries indiscriminatingly.  This was done due
     to my false assumption that one of the requirements in the
     diff-raw output was not to show such an entry (which
     resulted in my incorrect comment about "diff-helper never
     being able to be equivalent to built-in diff driver").  My
     special thanks go to Linus for correcting me about this.
     When we produce diff-raw output, for the downstream to be
     able to tell renames from copies, sometimes it _is_
     necessary to output "no-change" entries, and this patch
     adds diffcore_prune() function for doing it.

 (3) Earlier diff_filepair structure was trying to be not too
     specific about rename/copy operations, but the purpose of
     the structure was to record one or two paths, which _was_
     indeed about rename/copy.  This patch discards xfrm_msg
     field which was trying to be generic for this wrong reason,
     and introduces a couple of fields (rename_score and
     rename_rank) that are explicitly specific to rename/copy
     logic.  One thing to note is that the information in a
     single diff_filepair structure _still_ does not distinguish
     renames from copies, and it is deliberately so.  This is to
     allow patches to be reordered in later stages.

 (4) This patch also adds some tests about diff-raw format
     output and makes sure that necessary "no-change" entries
     appear on the output.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years ago[PATCH] Be careful with symlinks when detecting renames and copies.
Junio C Hamano [Mon, 23 May 2005 04:24:49 +0000 (21:24 -0700)]
[PATCH] Be careful with symlinks when detecting renames and copies.

Earlier round was not treating symbolic links carefully enough,
and would have produced diff output that renamed/copied then
edited the contents of a symbolic link, which made no practical
sense.  Change it to detect only pure renames.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
19 years agoStart implementing "git-apply"
Linus Torvalds [Mon, 23 May 2005 17:52:17 +0000 (10:52 -0700)]
Start implementing "git-apply"

This applies git patches (and old-style unified diffs)
in the index, rather than doing it in the working directory.

That allows for a lot more flexibility, and means that if a
patch fails, we aren't going to mess up the working directory.

NOTE! This is just the first cut at it, and right now it only
parses the incoming patch, it doesn't actually apply it yet.

19 years agoDon't care about st_dev in the index file
Linus Torvalds [Sun, 22 May 2005 22:08:15 +0000 (15:08 -0700)]
Don't care about st_dev in the index file

Thomas Glanzmann points out that it doesn't work well with different
clients accessing the repository over NFS - they have different views
on what the "device" for the filesystem is.

Of course, other filesystems may not even have stable inode numbers.
But we don't care. At least for now.

19 years agoSome more sparse warning fixes
Linus Torvalds [Sun, 22 May 2005 21:33:43 +0000 (14:33 -0700)]
Some more sparse warning fixes

Proper function declarations and NULL pointer usage.

19 years agoFix up git-fsck-cache documentation
Linus Torvalds [Sun, 22 May 2005 21:32:26 +0000 (14:32 -0700)]
Fix up git-fsck-cache documentation

Notably, the "--unreachable" flag no longer depends on specified heads,
and we should document what happens if no heads are given.

19 years agoInclude file cleanups..
Linus Torvalds [Sun, 22 May 2005 18:54:17 +0000 (11:54 -0700)]
Include file cleanups..

Add <limits.h> to the include files handled by "cache.h", and remove
extraneous #include directives from various .c files. The rule is that
"cache.h" gets all the basic stuff, so that we'll have as few system
dependencies as possible.

19 years ago[PATCH] Makefile: Solaris fix: call $(MAKE) instead of make for subdirectories
Thomas Glanzmann [Sun, 22 May 2005 18:27:28 +0000 (20:27 +0200)]
[PATCH] Makefile: Solaris fix: call $(MAKE) instead of make for subdirectories

Signed-off-by: Thomas Glanzmann <sithglan@stud.uni-erlangen.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>