summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* [PATCH] Do not include unused header files.Junio C Hamano2005-05-293-3/+0
| | | | | | | | 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>
* [PATCH] Pickaxe fixes.Junio C Hamano2005-05-295-5/+18
| | | | | | | | | | | | | 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>
* [PATCH] Rewrite ls-tree to behave more like "/bin/ls -a"Junio C Hamano2005-05-295-156/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* [PATCH] Adjust diff-helper to diff-tree -v -z changes.Junio C Hamano2005-05-291-1/+4
| | | | | | | | | | | | 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>
* [PATCH] Optimize diff-tree -[CM] --stdinJunio C Hamano2005-05-296-9/+102
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* [PATCH] Move pathspec to the beginning of the diffcore chain.Junio C Hamano2005-05-294-19/+19
| | | | | | | | | | | | | | | | | 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>
* [PATCH] Fix the way diffcore-rename records unremoved source.Junio C Hamano2005-05-294-80/+169
| | | | | | | | | | | | | | | | | 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>
* [PATCH] Add --pickaxe-all to diff-* brothers.Junio C Hamano2005-05-296-26/+81
| | | | | | | | | | 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>
* [PATCH] Remove a function not used anymore.Junio C Hamano2005-05-292-25/+0
| | | | | | | | | | 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>
* [PATCH] Clean up diff_setup() to make it more extensible.Junio C Hamano2005-05-295-16/+19
| | | | | | | | | 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>
* [PATCH] Remove final newline from the value of xfrm_msg variable.Junio C Hamano2005-05-292-4/+4
| | | | | | | | 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>
* [PATCH] Do not expose internal scaling to diff-helper.Junio C Hamano2005-05-292-3/+1
| | | | | | | | 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>
* [PATCH] Remove unused rank field from diff_core structure.Junio C Hamano2005-05-291-1/+0
| | | | | | | | 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>
* [PATCH] Make pathspec only care about the detination tree.Junio C Hamano2005-05-291-2/+1
| | | | | | | | | | | 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>
* [PATCH] Introduce diff_free_filepair() funcion.Junio C Hamano2005-05-295-13/+15
| | | | | | | | 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>
* [PATCH] Fix math thinko in similarity estimator.Junio C Hamano2005-05-291-1/+1
| | | | | | | 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>
* [PATCH] Document the --root switch of git-diff-treeThomas Glanzmann2005-05-291-0/+4
| | | | | Signed-off-by: Thomas Glanzmann <sithglan@stud.uni-erlangen.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] check_file_directory_conflict path fixDavid Meybohm2005-05-271-1/+3
| | | | | | | | | | | | | | | | | | | 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>
* git-diff-tree: simplify header output with '-z'Linus Torvalds2005-05-271-12/+5
| | | | | | | 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".
* [PATCH] allow pathspec to end with a slashJunio C Hamano2005-05-261-1/+5
| | | | | | | | | | | | 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>
* git-diff-tree: don't use diffcore_pathspec()Linus Torvalds2005-05-261-2/+0
| | | | | | | 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.
* [PATCH] fix and testcase for git-commit-tree optionRene Scharfe2005-05-262-1/+46
| | | | | | | | | | | 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>
* [PATCH] Make ls-* output consistent with diff-* output format.Junio C Hamano2005-05-265-94/+94
| | | | | | | | | 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>
* [PATCH] ls-tree matching multiple pathsJason McMullan2005-05-263-18/+227
| | | | | | | | | | | 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>
* [PATCH] Add git-external-diff-scriptJunio C Hamano2005-05-261-0/+67
| | | | | | | | | | | | | | | | 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>
* [PATCH] Diff updates to express type changesJunio C Hamano2005-05-262-9/+42
| | | | | | | | | | | | | | | | | | | | 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>
* git-apply: add "--check" option to check that the diff makes senseLinus Torvalds2005-05-261-26/+96
| | | | | It currently only verifies the index against the working directory, it doesn't actually verify the diff fragments themselves yet.
* git-apply: when validating default names, check the final EOLN tooLinus Torvalds2005-05-261-1/+1
| | | | | This means that filenames are totally unambiguous even if they have spaces or tabs in them.
* git-apply: pick up default filenames from "diff --git" header lineLinus Torvalds2005-05-261-10/+72
| | | | | Pure mode changes, and deletes or creates of empty files won't have this information anywhere else.
* git-apply: make the diffstat output happen for "--stat" only.Linus Torvalds2005-05-261-28/+68
| | | | | | 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.
* git-apply: implement "diffstat" outputLinus Torvalds2005-05-261-15/+77
| | | | | Hey, it's almost free by now, and it's a good way to see that we parse the patches correctly.
* git-apply: parse the whole list of patches into memory firstLinus Torvalds2005-05-261-90/+146
| | | | | | | | | | 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.
* [PATCH] Test case portability fix.Mark Allen2005-05-252-5/+3
| | | | | | | | | | | | 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>
* Make "parse_object()" also fill in commit message buffer data.Linus Torvalds2005-05-253-1/+7
| | | | And teach fsck to free it to save memory.
* git-rev-list: add "end" commit and "--header" flagLinus Torvalds2005-05-251-15/+42
| | | | | | | | | | 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.
* commit: save the commit buffer off when parsing a commitLinus Torvalds2005-05-252-0/+5
| | | | | | | | | | | | | 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.
* unpack_sha1_file: zero-pad the unpacked object.Linus Torvalds2005-05-251-1/+2
| | | | | | This makes them easier to parse without having to worry about running off the end, and allows us to treat commits as normal strings.
* [PATCH] Mode only changes from diff.Junio C Hamano2005-05-253-2/+40
| | | | | | | | | | | | 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>
* [PATCH] Fix type-change handling when assigning the status code to filepairs.Junio C Hamano2005-05-252-14/+25
| | | | | | | | | | | | | | | 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>
* [PATCH] Adjust show-files test for dotfiles.Junio C Hamano2005-05-251-3/+4
| | | | | | | | | | | | 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>
* git-pull-script: pretty-print the merge head informationLinus Torvalds2005-05-251-3/+12
| | | | | | 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.
* [PATCH] optimize git-resolve-scriptJeff Garzik2005-05-251-2/+2
| | | | | This change was suggested for my git-switch-tree script, and the same issues apply to core git's git-resolve-script as well.
* diff.c: don't silently ignore unknown state changes in diffs.Linus Torvalds2005-05-251-1/+1
| | | | Give them an "unknown" status, ie '?'.
* [PATCH] show changed tree objects with recursive git-diff-treeJunio C Hamano2005-05-252-2/+12
| | | | | | | | | | | 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>
* [PATCH] Use pathspec array correctlyJunio C Hamano2005-05-251-2/+2
| | | | | | | | | | | | | 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>
* git-rev-tree: teach it about tag referencesLinus Torvalds2005-05-241-24/+25
| | | | And various cleanups that makes it able to not care.
* [PATCH] Allow dot files in ls-files as well (take #2).Junio C Hamano2005-05-241-1/+4
| | | | | | | | 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>
* git-diff-cache: fix argument parsingLinus Torvalds2005-05-241-14/+22
| | | | And make the code more readable while at it.
* [PATCH] Update rename/copy similarity estimator.Junio C Hamano2005-05-244-7/+116
| | | | | | | | | | | 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>
* [PATCH] Squelch compiler warningJunio C Hamano2005-05-241-1/+1
| | | | | | | 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>