aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* tree/diff header cleanup.Junio C Hamano2006-03-29
| | | | | | | | | | | | | | | Introduce tree-walk.[ch] and move "struct tree_desc" and associated functions from various places. Rename DIFF_FILE_CANON_MODE(mode) macro to canon_mode(mode) and move it to cache.h. This macro returns the canonicalized st_mode value in the host byte order for files, symlinks and directories -- to be compared with a tree_desc entry. create_ce_mode(mode) in cache.h is similar but is intended to be used for index entries (so it does not work for directories) and returns the value in the network byte order. Signed-off-by: Junio C Hamano <junkio@cox.net>
* assume unchanged git: diff-index fix.Junio C Hamano2006-03-29
| | | | | | | | | | When the executable bit is untrustworthy and when we are comparing the tree with the working tree, we tried to reuse the mode bits recorded in the index incorrectly (the computation was bogus on little endian architectures). Just use mode from index when it is a regular file. Signed-off-by: Junio C Hamano <junkio@cox.net>
* revision.c "..B" syntax: constness fixJunio C Hamano2006-03-29
| | | | | | | The earlier change to make "..B" to mean "HEAD..B" (aka ^HEAD B) has constness gotcha GCC complains. Fix it. Signed-off-by: Junio C Hamano <junkio@cox.net>
* revision arguments: ..B means HEAD..B, just like A.. means A..HEADJunio C Hamano2006-03-29
| | | | | | | | For consistency reasons, we should probably allow that to be written as just "..branch", the same way we can write "branch.." to mean "everything in HEAD but not in "branch". Signed-off-by: Junio C Hamano <junkio@cox.net>
* rev-list --boundaryJunio C Hamano2006-03-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | With the new --boundary flag, the output from rev-list includes the UNINTERESING commits at the boundary, which are usually not shown. Their object names are prefixed with '-'. For example, with this graph: C side / A---B---D master You would get something like this: $ git rev-list --boundary --header --parents side..master D B tree D^{tree} parent B ... log message for commit D here ... \0-B A tree B^{tree} parent A ... log message for commit B here ... \0 Signed-off-by: Junio C Hamano <junkio@cox.net>
* rev-list: memory usage reduction.Junio C Hamano2006-03-28
| | | | | | | | | | We do not need to track object refs, neither we need to save commit unless we are doing verbose header. A lot of traversal happens inside prepare_revision_walk() these days so setting things up before calling that function is necessary. Signed-off-by: Junio C Hamano <junkio@cox.net> Acked-by: Linus Torvalds <torvalds@osdl.org>
* rev-list --no-merges: argument parsing fix.Junio C Hamano2006-03-28
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* xdiff: Show function names in hunk headers.Mark Wooding2006-03-27
| | | | | | | | | | | | | | | | | | | | The speed of the built-in diff generator is nice; but the function names shown by `diff -p' are /really/ nice. And I hate having to choose. So, we hack xdiff to find the function names and print them. xdiff has grown a flag to say whether to dig up the function names. The builtin_diff function passes this flag unconditionally. I suppose it could parse GIT_DIFF_OPTS, but it doesn't at the moment. I've also reintroduced the `function name' into the test suite, from which it was removed in commit 3ce8f089. The function names are parsed by a particularly stupid algorithm at the moment: it just tries to find a line in the `old' file, from before the start of the hunk, whose first character looks plausible. Still, it's most definitely a start. Signed-off-by: Mark Wooding <mdw@distorted.org.uk> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Add ALL_LDFLAGS to the git target.Jason Riedy2006-03-27
| | | | | | | | | | For some reason, I need ALL_LDFLAGS in the git target only on AIX. Once it builds, only one test "fails" on AIX 5.1 with 1.3.0.rc1, t5500-fetch-pack.sh, but it looks like it's some odd tool problem in the tester + my setup and not a real bug. Signed-off-by: Jason Riedy <ejr@cs.berkeley.edu> Signed-off-by: Junio C Hamano <junkio@cox.net>
* GIT 1.3.0 rc1v1.3.0-rc1Junio C Hamano2006-03-27
| | | | | | | | | | | | All of the things that were not in the "master" branch were either cooked long enough in "next" without causing problems (e.g. insanely fast rename detector or true built-in diff) or isolated in a specific subsystem (e.g. tar-tree and svnimport). So I am clearing the deck to prepare for a 1.3.0. Remaining wrinkles, if any, will be ironed in the "master" branch. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch ak/svnJunio C Hamano2006-03-27
|\
| * git-svnimport: if a limit is specified, respect itAnand Kumria2006-03-26
| | | | | | | | | | | | | | | | | | git-svnimport will import the same revision over and over again if a limit (-l <rev>) has been specified. Instead if that revision has already been processed, exit with an up-to-date message. Signed-off-by: Anand Kumria <wildfire@progsoc.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Merge branch 'lt/diffgen' into nextJunio C Hamano2006-03-26
|\ \ | | | | | | | | | | | | | | | * lt/diffgen: add clean and ignore rules for xdiff/ Remove dependency on a file named "-lz"
| * | add clean and ignore rules for xdiff/Junio C Hamano2006-03-26
| | | | | | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | Remove dependency on a file named "-lz"Johannes Schindelin2006-03-26
| | | | | | | | | | | | | | | | | | | | | | | | By changing the dependency "$(LIB_H)" to "$(LIBS)", at least one version of make thought that a file named "-lz" would be needed. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Merge branch 'master' into nextJunio C Hamano2006-03-26
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | * master: Optionally do not list empty directories in git-ls-files --others Document git-rebase behavior on conflicts. Fix error handling for nonexistent names
| * | | Optionally do not list empty directories in git-ls-files --othersPetr Baudis2006-03-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without the --directory flag, git-ls-files wouldn't ever list directories, producing no output for empty directories, which is good since they cannot be added and they bear no content, even untracked one (if Git ever starts tracking directories on their own, this should obviously change since the content notion will change). With the --directory flag however, git-ls-files would list even empty directories. This may be good in some situations but sometimes you want to prevent that. This patch adds a --no-empty-directory option which makes git-ls-files omit empty directories. Signed-off-by: Petr Baudis <pasky@suse.cz>
| * | | Document git-rebase behavior on conflicts.J. Bruce Fields2006-03-26
| | | |
| * | | Fix error handling for nonexistent namesLinus Torvalds2006-03-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When passing in a pathname pattern without the "--" separator on the command line, we verify that the pathnames in question exist. However, there were two bugs in that verification: - git-rev-parse would only check the first pathname, and silently allow any invalid subsequent pathname, whether it existed or not (which defeats the purpose of the check, and is also inconsistent with what git-rev-list actually does) - git-rev-list (and "git log" etc) would check each filename, but if the check failed, it would print the error using the first one, i.e.: [torvalds@g5 git]$ git log Makefile bad-file fatal: 'Makefile': No such file or directory instead of saying that it's 'bad-file' that doesn't exist. This fixes both bugs. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | Merge branch 'jc/thin' into nextJunio C Hamano2006-03-26
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jc/thin: git-push: make --thin pack transfer the default. gitk: Fix two bugs reported by users gitk: Improve appearance of first child links gitk: Make downward-pointing arrows end in vertical line segment gitk: Don't change cursor at end of layout if find in progress gitk: Make commitdata an array rather than a list gitk: Fix display of diff lines beginning with --- or +++ [PATCH] gitk: Make error_popup react to Return gitk: Fix a bug in drawing the selected line as a thick line gitk: Further speedups gitk: Various speed improvements gitk: Fix Update menu item gitk: Fix clicks on arrows on line ends gitk: New improved gitk contrib/git-svn: stabilize memory usage for big fetches
| * | | | git-push: make --thin pack transfer the default.Junio C Hamano2006-03-26
| |/ / / | | | | | | | | | | | | | | | | | | | | Just in case it has problems, you can say "git push --no-thin". Signed-off-by: Junio C Hamano <junkio@cox.net>
| | | |
| | \ \
| *-. \ \ Merge branches 'jc/clone' and 'jc/name'Junio C Hamano2006-03-26
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jc/clone: git-clone: typofix. clone: record the remote primary branch with remotes/$origin/HEAD revamp git-clone (take #2). revamp git-clone. fetch,parse-remote,fmt-merge-msg: refs/remotes/* support * jc/name: sha1_name: make core.warnambiguousrefs the default. sha1_name: warning ambiguous refs. get_sha1_basic(): try refs/... and finally refs/remotes/$foo/HEAD core.warnambiguousrefs: warns when "name" is used and both "name" branch and tag exists.
| * \ \ \ \ Merge branch 'jc/merge'Junio C Hamano2006-03-26
| |\ \ \ \ \ | | |_|_|_|/ | |/| | | | | | | | | | | | | | | | * jc/merge: git-merge knows some strategies want to skip trivial merges
| * | | | | Merge git://git.kernel.org/pub/scm/gitk/gitkJunio C Hamano2006-03-26
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/gitk/gitk: gitk: Fix two bugs reported by users gitk: Improve appearance of first child links gitk: Make downward-pointing arrows end in vertical line segment gitk: Don't change cursor at end of layout if find in progress gitk: Make commitdata an array rather than a list gitk: Fix display of diff lines beginning with --- or +++ [PATCH] gitk: Make error_popup react to Return gitk: Fix a bug in drawing the selected line as a thick line gitk: Further speedups gitk: Various speed improvements gitk: Fix Update menu item gitk: Fix clicks on arrows on line ends gitk: New improved gitk
| | * | | | | gitk: Fix two bugs reported by usersPaul Mackerras2006-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first was a simple typo where I put $yc instead of [yc $row]. The second was that I broke the logic for keeping up with fast movement through the commits, e.g. when you select a commit and then press down-arrow and let it autorepeat. That got broken when I changed the merge diff display to use git-diff-tree --cc. Signed-off-by: Paul Mackerras <paulus@samba.org>
| | * | | | | gitk: Improve appearance of first child linksPaul Mackerras2006-03-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The point where the line for a parent joins to the first child shown is visually different from the lines to the other children, because the line doesn't branch, but terminates at the child. Because of this, we now treat the first child a little differently in the optimizer, and we draw its link in drawlineseg rather than drawparentlinks. This improves the appearance of the graph. Signed-off-by: Paul Mackerras <paulus@samba.org>
| | * | | | | gitk: Make downward-pointing arrows end in vertical line segmentPaul Mackerras2006-03-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems Tk 8.4 can't draw arrows on diagonal line segments. This adds code to the optimizer to make the last bit of a line go vertically before being terminated with an arrow pointing downwards, so that it will be drawn correctly by Tk 8.4. Signed-off-by: Paul Mackerras <paulus@samba.org>
| | * | | | | gitk: Don't change cursor at end of layout if find in progressPaul Mackerras2006-03-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the user is doing a find in files or patches, which changed the cursor to a watch, don't change it back to a pointer when we reach the end of laying out the graph. Signed-off-by: Paul Mackerras <paulus@samba.org>
| | * | | | | gitk: Make commitdata an array rather than a listPaul Mackerras2006-03-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This turns out to be slightly simpler and faster, and will make things a little easier when we do multiple view support. Signed-off-by: Paul Mackerras <paulus@samba.org>
| | * | | | | gitk: Fix display of diff lines beginning with --- or +++Paul Mackerras2006-03-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lines in a diff beginning with --- or +++ were not being displayed at all. Thanks to Robert Fitzsimons for pointing out the obvious fix, that lines beginning with --- or +++ are only to be suppressed in the diff header. I also took the opportunity to replace a regexp call with a couple of string compare calls, which should be faster. Signed-off-by: Paul Mackerras <paulus@samba.org>
| | * | | | | [PATCH] gitk: Make error_popup react to ReturnMartin Mares2006-03-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The error popup window can be now closed not only by clicking the button, but also by pressing Return. Signed-Off-By: Martin Mares <mj@ucw.cz> Signed-off-by: Paul Mackerras <paulus@samba.org>
| | * | | | | gitk: Fix a bug in drawing the selected line as a thick linePaul Mackerras2006-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you clicked on a line, so that it was drawn double-thickness, and then scrolled to bring on-screen a child that hadn't previously been drawn, the lines from it to the selected line were drawn single-thickness. This fixes it so they are drawn double-thickness. This also removes an unnecessary setting of phase in drawrest. Signed-off-by: Paul Mackerras <paulus@samba.org>
| | * | | | | gitk: Further speedupsPaul Mackerras2006-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now we don't parse the commits as we are reading them, we just put commit data on a list as a blob, and instead parse the commit when we need the various parts of it, such as when a commit is drawn on the canvas. This makes searching a bit more interesting: now we scan through the commit blobs doing a string or regexp match to find commits that might match, then for those that might match, we parse the commit info (if it isn't already parsed) and do the matching for the various fields as before. Signed-off-by: Paul Mackerras <paulus@samba.org>
| | * | | | | gitk: Various speed improvementsPaul Mackerras2006-02-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This rearranges the code a little to eliminate some procedure calls and reduce the number of globals accessed. It makes rowidlist and rowoffsets lists rather than arrays, and removes the lineid array, since $lineid($l) was the same as [lindex $displayorder $l], and the latter is a little faster. Signed-off-by: Paul Mackerras <paulus@samba.org>
| | * | | | | gitk: Fix Update menu itemPaul Mackerras2006-02-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This just does the simple thing of resetting everything, reading all the commits, and redoing the whole layout from scratch. Hopefully things are now fast enough that this simple approach is acceptable. Also, this fits in better with future plans for adding the ability to restrict the tree to just a few files and then expand back to the whole tree. Signed-off-by: Paul Mackerras <paulus@samba.org>
| | * | | | | gitk: Fix clicks on arrows on line endsPaul Mackerras2006-02-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the new representation of the graph lines, this turns out much simpler now. Signed-off-by: Paul Mackerras <paulus@samba.org>
| | * | | | | gitk: New improved gitkPaul Mackerras2006-02-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a new version of gitk which is much faster and has much better graph layout. It achieves the speed by only drawing the parts of the canvases that are actually visible. It also draws the commits in the order that git-rev-list produces them, so if you use -d, you need to have a recent enough git-rev-list that understands the --date-order flag. Signed-off-by: Paul Mackerras <paulus@samba.org>
| * | | | | | contrib/git-svn: stabilize memory usage for big fetchesEric Wong2006-03-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should be safely able to import histories with thousands of revisions without hogging up lots of memory. With this, we lose the ability to autocorrect mistakes when people specify revisions in reverse, but it's probably no longer a problem since we only have one method of log parsing nowadays. I've added an extra check to ensure that revision numbers do increment. Also, increment the version number to 0.11.0. I really should just call it 1.0 soon... Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | | | | Merge branch 'lt/diffgen' into nextJunio C Hamano2006-03-26
|\ \ \ \ \ \ \ | | |_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | * lt/diffgen: true built-in diff: run everything in-core.
| * | | | | | true built-in diff: run everything in-core.Junio C Hamano2006-03-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This stops using temporary files when we are using the built-in diff (including the complete rewrite). Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | | | | Merge branch 'ew/email' into nextJunio C Hamano2006-03-25
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ew/email: send-email: lazy-load Email::Valid and make it optional send-email: try to order messages in email clients more correctly send-email: Change from Mail::Sendmail to Net::SMTP send-email: use built-in time() instead of /bin/date '+%s'
| * | | | | | | send-email: lazy-load Email::Valid and make it optionalEric Wong2006-03-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's not installed on enough machines, and is overkill most of the time. We'll fallback to a very basic regexp just in case, but nothing like the monster regexp Email::Valid has to offer :) Small cleanup from Merlyn. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | | | | send-email: try to order messages in email clients more correctlyEric Wong2006-03-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If --no-chain-reply-to is set, patches may not always be ordered correctly in email clients. This patch makes sure each email sent from a different second. I chose to start with a time (slightly) in the past because those are probably more likely in real-world usage and spam filters might be more tolerant of them. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | | | | send-email: Change from Mail::Sendmail to Net::SMTPEric Wong2006-03-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Net::SMTP is in the base Perl distribution, so users are more likely to have it. Net::SMTP also allows reusing the SMTP connection, so sending multiple emails is faster. [jc: tweaked X-Mailer further while we are at it.] Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | | | | send-email: use built-in time() instead of /bin/date '+%s'Eric Wong2006-03-25
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | | | | Merge branch 'lt/diffgen' into nextJunio C Hamano2006-03-25
|\ \ \ \ \ \ \ | | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lt/diffgen: built-in diff: minimum tweaks builtin-diff: \No newline at end of file. Use a *real* built-in diff generator
| * | | | | | built-in diff: minimum tweaksJunio C Hamano2006-03-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes up a couple of minor issues with the real built-in diff to be more usable: - Omit ---/+++ header unless we emit diff output; - Detect and punt binary diff like GNU does; - Honor GIT_DIFF_OPTS minimally (only -u<number> and --unified=<number> are currently supported); - Omit line count of 1 from "@@ -l,k +m,n @@" hunk header (i.e. when k == 1 or n == 1) - Adjust testsuite for the lack of -p support. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | | | builtin-diff: \No newline at end of file.Linus Torvalds2006-03-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | | | | | Use a *real* built-in diff generatorLinus Torvalds2006-03-25
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This uses a simplified libxdiff setup to generate unified diffs _without_ doing fork/execve of GNU "diff". This has several huge advantages, for example: Before: [torvalds@g5 linux]$ time git diff v2.6.16.. > /dev/null real 0m24.818s user 0m13.332s sys 0m8.664s After: [torvalds@g5 linux]$ time git diff v2.6.16.. > /dev/null real 0m4.563s user 0m2.944s sys 0m1.580s and the fact that this should be a lot more portable (ie we can ignore all the issues with doing fork/execve under Windows). Perhaps even more importantly, this allows us to do diffs without actually ever writing out the git file contents to a temporary file (and without any of the shell quoting issues on filenames etc etc). NOTE! THIS PATCH DOES NOT DO THAT OPTIMIZATION YET! I was lazy, and the current "diff-core" code actually will always write the temp-files, because it used to be something that you simply had to do. So this current one actually writes a temp-file like before, and then reads it into memory again just to do the diff. Stupid. But if this basic infrastructure is accepted, we can start switching over diff-core to not write temp-files, which should speed things up even further, especially when doing big tree-to-tree diffs. Now, in the interest of full disclosure, I should also point out a few downsides: - the libxdiff algorithm is different, and I bet GNU diff has gotten a lot more testing. And the thing is, generating a diff is not an exact science - you can get two different diffs (and you will), and they can both be perfectly valid. So it's not possible to "validate" the libxdiff output by just comparing it against GNU diff. - GNU diff does some nice eye-candy, like trying to figure out what the last function was, and adding that information to the "@@ .." line. libxdiff doesn't do that. - The libxdiff thing has some known deficiencies. In particular, it gets the "\No newline at end of file" case wrong. So this is currently for the experimental branch only. I hope Davide will help fix it. That said, I think the huge performance advantage, and the fact that it integrates better is definitely worth it. But it should go into a development branch at least due to the missing newline issue. Technical note: this is based on libxdiff-0.17, but I did some surgery to get rid of the extraneous fat - stuff that git doesn't need, and seriously cutting down on mmfile_t, which had much more capabilities than the diff algorithm either needed or used. In this version, "mmfile_t" is just a trivial <pointer,length> tuple. That said, I tried to keep the differences to simple removals, so that you can do a diff between this and the libxdiff origin, and you'll basically see just things getting deleted. Even the mmfile_t simplifications are left in a state where the diffs should be readable. Apologies to Davide, whom I'd love to get feedback on this all from (I wrote my own "fill_mmfile()" for the new simpler mmfile_t format: the old complex format had a helper function for that, but I did my surgery with the goal in mind that eventually we _should_ just do mmfile_t mf; buf = read_sha1_file(sha1, type, &size); mf->ptr = buf; mf->size = size; .. use "mf" directly .. which was really a nightmare with the old "helpful" mmfile_t, and really is that easy with the new cut-down interfaces). [ Btw, as any hawk-eye can see from the diff, this was actually generated with itself, so it is "self-hosting". That's about all the testing it has gotten, along with the above kernel diff, which eye-balls correctly, but shows the newline issue when you double-check it with "git-apply" ] Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | | | | Merge branch 'rs/tar-tree' into nextJunio C Hamano2006-03-25
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * rs/tar-tree: tar-tree: Use the prefix field of a tar header tar-tree: Remove obsolete code tar-tree: Use write_entry() to write the archive contents tar-tree: Introduce write_entry() tar-tree: Use SHA1 of root tree for the basedir git-apply: safety fixes Removed bogus "<snap>" identifier. Clarify and expand some hook documentation. commit-tree: check return value from write_sha1_file() send-email: Identify author at the top when sending e-mail Format tweaks for asciidoc.