summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* [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>
* [PATCH] Allow symlinks in the leading path in checkout-cache --prefix=Junio C Hamano2005-05-242-13/+110
| | | | | | | | | | | | 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>
* [PATCH] Use DIFF_FORMAT_NO_OUTPUT to implement diff-tree -s option.Junio C Hamano2005-05-241-12/+2
| | | | | | | | | 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>
* git-update-cache: allow dot-filesLinus Torvalds2005-05-241-4/+40
| | | | | | | 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.
* git-commit-tree: allow overriding of commit dateLinus Torvalds2005-05-241-2/+5
| | | | Using GIT_COMMITTER_DATE, of course..
* [PATCH] Redo rename/copy detection logic.Junio C Hamano2005-05-246-252/+314
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* git-apply: more consistency checks on gitdiff filenamesLinus Torvalds2005-05-231-4/+46
| | | | | | 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.
* [PATCH] adjust git-deltafy-script to the new diff-tree output formatNicolas Pitre2005-05-231-2/+3
| | | | | | | | 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>
* [PATCH] Update git-diff-cache documentation.Junio C Hamano2005-05-232-5/+7
| | | | | | | | 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>
* [PATCH] Fix diff-pruning logic which was running prune too early.Junio C Hamano2005-05-238-127/+69
| | | | | | | | | | | | | 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>
* git-apply: start using the index file information.Linus Torvalds2005-05-231-19/+68
| | | | | Right now we only use it to figure out what the filename might be when that is ambiguous, but we'll get there..
* git-apply: if no input files specified, apply stdinLinus Torvalds2005-05-231-0/+5
| | | | This makes it act more like a traditional UNIX thing (eg "cat").
* diff-tree: don't write headers if the diff queue is emptyLinus Torvalds2005-05-231-5/+5
| | | | | This is not a pickaxe-specific thing, we do this regardless of what has pruned down the diff queue.
* git-apply: unknown modes are zero, not -1Linus Torvalds2005-05-231-1/+1
|
* [PATCH] diff-raw format update take #2.Junio C Hamano2005-05-2313-366/+494
| | | | | | | | | | | 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>
* git-apply: parse the diff headers (both traditional and new)Linus Torvalds2005-05-231-31/+217
| | | | | | | | | .. 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.
* git-apply: improve error detection and messagesLinus Torvalds2005-05-231-42/+74
| | | | | | 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).
* git-apply: bad patch fragments are fatalLinus Torvalds2005-05-231-1/+1
| | | | | Don't just stop at them and look for the next header. Die, die, die!