summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2005-05-31[PATCH] diff: consolidate test helper script pieces.Junio C Hamano
There were duplicate script pieces to help comparing diff output, which this patch consolidates into the t/diff-lib.sh library. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-31pathspec: fix pathspecs with '/' at the endLinus Torvalds
Removing (and ignoring) them is wrong, since that means that a pathspec of "xxxx/" would match a regular filename of "xxxx", which is obviously incorrect.
2005-05-31git-apply: don't try to be clever about filenames and the indexLinus Torvalds
It just causes things like "git-apply --stat" to parse traditional patch headers differently depending on what your index is, which is nasty.
2005-05-31git-rev-list: add "--parents" command line flagLinus Torvalds
It makes rev-list show the list of parents, the same way git-rev-tree does (but without the expense).
2005-05-31git-rev-list: use proper lazy reachability analysisLinus Torvalds
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.
2005-05-31commit_list_insert: return the new commit list entryLinus Torvalds
This is useful for when we want to insert the next one after this new one, for example.
2005-05-31[PATCH] Show dissimilarity index for D and N case.Junio C Hamano
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>
2005-05-31[PATCH] Add -O<orderfile> option to diff-* brothers.Junio C Hamano
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>
2005-05-31[PATCH] Buglets fix in the new two scriptsJunio C Hamano
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>
2005-05-31git-resolve-script: use "git-apply --stat" instead of diffstatLinus Torvalds
Not everybody necessarily even has diffstat installed.
2005-05-31[PATCH] mkdelta enhancements (take 2)Nicolas Pitre
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>
2005-05-30Add "commit" helper scriptLinus Torvalds
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.
2005-05-30[PATCH] Add -B flag to diff-* brothers.Junio C Hamano
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>
2005-05-30[PATCH] diff: fix the culling of unneeded delete record.Junio C Hamano
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>
2005-05-30[PATCH] diff: further cleanup.Junio C Hamano
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>
2005-05-30[PATCH] diff: code clean-up and removal of rename hack.Junio C Hamano
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>
2005-05-30[PATCH] diff: consolidate various calls into diffcore.Junio C Hamano
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>
2005-05-30[PATCH] diff-helper: Fix R/C score parsing under -z flag.Junio C Hamano
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>
2005-05-30git-init-db: set up the full default environmentLinus Torvalds
Create .git/refs/{heads,tags} and make .git/HEAD be a symlink to (the as yet non-existent) .git/refs/heads/master.
2005-05-29git-mktag: be more careful in reading the input.Linus Torvalds
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.
2005-05-29[PATCH] Fix count-delta overcountingJunio C Hamano
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>
2005-05-29[PATCH] Do not include unused header files.Junio C Hamano
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>
2005-05-29[PATCH] Pickaxe fixes.Junio C Hamano
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>
2005-05-29[PATCH] Rewrite ls-tree to behave more like "/bin/ls -a"Junio C Hamano
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>
2005-05-29[PATCH] Adjust diff-helper to diff-tree -v -z changes.Junio C Hamano
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>
2005-05-29[PATCH] Optimize diff-tree -[CM] --stdinJunio C Hamano
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>
2005-05-29[PATCH] Move pathspec to the beginning of the diffcore chain.Junio C Hamano
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>
2005-05-29[PATCH] Fix the way diffcore-rename records unremoved source.Junio C Hamano
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>
2005-05-29[PATCH] Add --pickaxe-all to diff-* brothers.Junio C Hamano
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>
2005-05-29[PATCH] Remove a function not used anymore.Junio C Hamano
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>
2005-05-29[PATCH] Clean up diff_setup() to make it more extensible.Junio C Hamano
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>
2005-05-29[PATCH] Remove final newline from the value of xfrm_msg variable.Junio C Hamano
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>
2005-05-29[PATCH] Do not expose internal scaling to diff-helper.Junio C Hamano
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>
2005-05-29[PATCH] Remove unused rank field from diff_core structure.Junio C Hamano
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>
2005-05-29[PATCH] Make pathspec only care about the detination tree.Junio C Hamano
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>
2005-05-29[PATCH] Introduce diff_free_filepair() funcion.Junio C Hamano
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>
2005-05-29[PATCH] Fix math thinko in similarity estimator.Junio C Hamano
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>
2005-05-29[PATCH] Document the --root switch of git-diff-treeThomas Glanzmann
Signed-off-by: Thomas Glanzmann <sithglan@stud.uni-erlangen.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-05-27[PATCH] check_file_directory_conflict path fixDavid Meybohm
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>
2005-05-27git-diff-tree: simplify header output with '-z'Linus Torvalds
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".
2005-05-27[PATCH] allow pathspec to end with a slashJunio C Hamano
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>
2005-05-27git-diff-tree: don't use diffcore_pathspec()Linus Torvalds
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.
2005-05-26[PATCH] fix and testcase for git-commit-tree optionRene Scharfe
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>
2005-05-26[PATCH] Make ls-* output consistent with diff-* output format.Junio C Hamano
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>
2005-05-26[PATCH] ls-tree matching multiple pathsJason McMullan
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>
2005-05-26[PATCH] Add git-external-diff-scriptJunio C Hamano
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>
2005-05-26[PATCH] Diff updates to express type changesJunio C Hamano
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>
2005-05-26git-apply: add "--check" option to check that the diff makes senseLinus Torvalds
It currently only verifies the index against the working directory, it doesn't actually verify the diff fragments themselves yet.
2005-05-26git-apply: when validating default names, check the final EOLN tooLinus Torvalds
This means that filenames are totally unambiguous even if they have spaces or tabs in them.
2005-05-26git-apply: pick up default filenames from "diff --git" header lineLinus Torvalds
Pure mode changes, and deletes or creates of empty files won't have this information anywhere else.