summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* log/whatchanged/show - log formatting cleanup.Junio C Hamano2006-04-163-15/+30
| | | | | | | | This moves the decision to print the log message, while diff options are in effect, to log-tree. It gives behaviour closer to the traditional one. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Simplify common default options setup for built-in log family.Junio C Hamano2006-04-161-13/+7
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'master' into lt/logoptJunio C Hamano2006-04-168-21/+169
|\ | | | | | | | | | | | | | | | | | | | | | | * master: pager: do not fork a pager if PAGER is set to empty. diff-options: add --patch-with-stat diff-files --stat: do not dump core with unmerged index. Support "git cmd --help" syntax diff --stat: do not do its own three-dashes. diff-tree: typefix. GIT v1.3.0-rc4 xdiff: post-process hunks to make them consistent.
| * pager: do not fork a pager if PAGER is set to empty.Johannes Schindelin2006-04-161-7/+10
| | | | | | | | | | | | | | | | | | | | This skips an extra pipe, and helps debugging tremendously. [jc: PAGER=cat is a questionable hack and should be done as a separate patch. ] Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * diff-options: add --patch-with-statJohannes Schindelin2006-04-153-1/+22
| | | | | | | | | | | | | | | | | | | | With this option, git prepends a diffstat in front of the patch. Since I really, really do not know what a diffstat of a combined diff ("merge diff") should look like, the diffstat is not generated for these. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * diff-files --stat: do not dump core with unmerged index.Junio C Hamano2006-04-151-4/+17
| | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
| * Support "git cmd --help" syntaxLinus Torvalds2006-04-151-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "--help" argument is special, in that it is (along with "--version") in that is taken by the "git" program itself rather than the sub-command, and thus we've had the syntax "git --help cmd". However, as anybody who has ever used CVS or some similar devil-spawn program, it's confusing as h*ll when options before the sub-command act differently from options after the sub-command, so this quick hack just makes it acceptable to do "git cmd --help" instead, and get the exact same result. It may be hacky, but it's simple and does the trick. Of course, this does not help if you use one of the non-builtin commands without using the "git" helper. Ie you won't be getting a man-page just because you do "git-rev-list --help". Don't expect us to be quite _that_ helpful. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * diff --stat: do not do its own three-dashes.Junio C Hamano2006-04-152-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | I missed that "git-diff-* --stat" spits out three-dash separator on its own without being asked. Remove it. When we output commit log followed by diff, perhaps --patch-with-stat, for downstream consumer, we _would_ want the three-dash between the message and the diff material, but that logic belongs to the caller, not diff generator. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * diff-tree: typefix.Junio C Hamano2006-04-151-1/+1
| | | | | | | | | | | | | | | | | | Recent diff_tree_setup_paths() update made it take a second argument of type "struct diff_options", but we passed another struct that happenes to have that type at the beginning by mistake. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * GIT v1.3.0-rc4v1.3.0-rc4Junio C Hamano2006-04-141-1/+1
| | | | | | | | | | | | | | | | I've merged everything I think is ready for 1.3.0, so this is the final round -- hopefully I can release this with minimum last-minute fixup as v1.3.0 early next week. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * Merge branch 'dl/xdiff'Junio C Hamano2006-04-142-5/+110
| |\ | | | | | | | | | | | | * dl/xdiff: xdiff: post-process hunks to make them consistent.
| | * xdiff: post-process hunks to make them consistent.Davide Libenzi2006-04-132-5/+110
| | |
* | | Tentative built-in "git show"Linus Torvalds2006-04-163-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This uses the "--no-walk" flag that I never actually implemented (but I'm sure I mentioned it) to make "git show" be essentially the same thing as "git whatchanged --no-walk". It just refuses to add more interesting parents to the revision walking history, so you don't actually get any history, you just get the commit you asked for. I was going to add "--no-walk" as a real argument flag to git-rev-list too, but I'm not sure anybody actually needs it. Although it might be useful for porcelain, so I left the door open. [jc: ported to the unified option structure by Linus] Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Built-in git-whatchanged.Junio C Hamano2006-04-161-19/+43
| | | | | | | | | | | | | | | | | | | | | | | | Split internal "git log" into reusable piece and add "git whatchanged". This is based on the option parsing unification work Linus did. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | rev-list option parser fix.Junio C Hamano2006-04-151-59/+23
| | | | | | | | | | | | | | | | | | | | | The big option parser unification broke rev-list the big way; this makes it use options from the parsed revs structure. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Split init_revisions() out of setup_revisions()Junio C Hamano2006-04-155-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merging all three option parsers related to whatchanged is unarguably the right thing, but the fallout was too big to scare me away. Let's try it once again, but once step at time. This splits out init_revisions() call from setup_revisions(), so that the callers can set different defaults to match the traditional benaviour. The rev-list command is still broken in a big way, which is the topic of next step. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Fix up rev-list option parsing.Junio C Hamano2006-04-141-2/+4
| | | | | | | | | | | | | | | | | | rev-list does not take diff options, so barf after seeing some. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Fix up default abbrev in setup_revisions() argument parser.Junio C Hamano2006-04-143-0/+7
| | | | | | | | | | | | | | | | | | The default abbreviation precision should be DEFAULT_ABBREV as before. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Common option parsing for "git log --diff" and friendsLinus Torvalds2006-04-146-227/+218
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This basically does a few things that are sadly somewhat interdependent, and nontrivial to split out - get rid of "struct log_tree_opt" The fields in "log_tree_opt" are moved into "struct rev_info", and all users of log_tree_opt are changed to use the rev_info struct instead. - add the parsing for the log_tree_opt arguments to "setup_revision()" - make setup_revision set a flag (revs->diff) if the diff-related arguments were used. This allows "git log" to decide whether it wants to show diffs or not. - make setup_revision() also initialize the diffopt part of rev_info (which we had from before, but we just didn't initialize it) - make setup_revision() do all the "finishing touches" on it all (it will do the proper flag combination logic, and call "diff_setup_done()") Now, that was the easy and straightforward part. The slightly more involved part is that some of the programs that want to use the new-and-improved rev_info parsing don't actually want _commits_, they may want tree'ish arguments instead. That meant that I had to change setup_revision() to parse the arguments not into the "revs->commits" list, but into the "revs->pending_objects" list. Then, when we do "prepare_revision_walk()", we walk that list, and create the sorted commit list from there. This actually cleaned some stuff up, but it's the less obvious part of the patch, and re-organized the "revision.c" logic somewhat. It actually paves the way for splitting argument parsing _entirely_ out of "revision.c", since now the argument parsing really is totally independent of the commit walking: that didn't use to be true, since there was lots of overlap with get_commit_reference() handling etc, now the _only_ overlap is the shared (and trivial) "add_pending_object()" thing. However, I didn't do that file split, just because I wanted the diff itself to be smaller, and show the actual changes more clearly. If this gets accepted, I'll do further cleanups then - that includes the file split, but also using the new infrastructure to do a nicer "git diff" etc. Even in this form, it actually ends up removing more lines than it adds. It's nice to note how simple and straightforward this makes the built-in "git log" command, even though it continues to support all the diff flags too. It doesn't get much simpler that this. I think this is worth merging soonish, because it does allow for future cleanup and even more sharing of code. However, it obviously touches "revision.c", which is subtle. I've tested that it passes all the tests we have, and it passes my "looks sane" detector, but somebody else should also give it a good look-over. [jc: squashed the original and three "oops this too" updates, with another fix-up.] Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Merge branch 'js/diffstat'Junio C Hamano2006-04-144-7/+226
|\ \ | | | | | | | | | | | | | | | | | | * js/diffstat: diff --stat: no need to ask funcnames nor context. diff-options: add --stat (take 2) diff-options: add --stat (take 2)
| * | diff --stat: no need to ask funcnames nor context.Junio C Hamano2006-04-131-2/+2
| | | | | | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | diff-options: add --stat (take 2)Johannes Schindelin2006-04-131-5/+5
| | | | | | | | | | | | | | | | | | | | | ... and a fix for an invalid free(): Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | diff-options: add --stat (take 2)Johannes Schindelin2006-04-134-7/+226
| |/ | | | | | | | | | | | | | | | | Now, you can say "git diff --stat" (to get an idea how many changes are uncommitted), or "git log --stat". Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Merge branch 'jc/fix5500'Junio C Hamano2006-04-141-19/+14
|\ \ | | | | | | | | | | | | * jc/fix5500: t5500: test fix
| * | t5500: test fixJunio C Hamano2006-04-131-19/+14
| | | | | | | | | | | | | | | | | | | | | | | | Relying on eye-candy progress bar was fragile to begin with. Run fetch-pack with -k option, and count the objects that are in the pack that were transferred from the other end. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Clean up trailing whitespace when pretty-printing commitsLinus Torvalds2006-04-141-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Partly because we've messed up and now have some commits with trailing whitespace, but partly because this also just simplifies the code, let's remove trailing whitespace from the end when pretty-printing commits. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | "git cmd -h" for shell scripts.Junio C Hamano2006-04-141-1/+1
| | | | | | | | | | | | | | | | | | | | | Wrappers that use sh-setup took --help but not -h. Noticed by Sébastien Pierre. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | git-log <diff-options> <paths> documentationJunio C Hamano2006-04-141-4/+20
| | | | | | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Retire git-log.sh (take #4)Junio C Hamano2006-04-141-15/+0
| | | | | | | | | | | | | | | | | | | | | Noticed by Johannes. We do not install it anymore, but still have been shipping the source, which was crazy. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | stripspace: incomplete line fix (take #2)Junio C Hamano2006-04-141-1/+3
|/ / | | | | | | | | | | | | | | This fixes f4ee3eb68906f079dea45de4f1bbb03d68189eb3 breakage, which added an extra trailing blank line after stripping trailing blank lines by mistake. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Fix-up previous expr changes.Junio C Hamano2006-04-132-3/+3
|/ | | | | | | | | | | | | | The regexp on the right hand side of expr : operator somehow was broken. expr 'z+pu:refs/tags/ko-pu' : 'z\+\(.*\)' does not strip '+'; write 'z+\(.*\)' instead. We probably should switch to shell based substring post 1.3.0; that's not bashism but just POSIX anyway. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Shell utilities: Guard against expr' magic tokens.Mark Wooding2006-04-139-30/+30
| | | | | | | | | Some words, e.g., `match', are special to expr(1), and cause strange parsing effects. Track down all uses of expr and mangle the arguments so that this isn't a problem. Signed-off-by: Mark Wooding <mdw@distorted.org.uk> Signed-off-by: Junio C Hamano <junkio@cox.net>
* t3600-rm: skip failed-remove test when we cannot make an unremovable file.Junio C Hamano2006-04-131-3/+15
| | | | | | | | When running t3600-rm test under fakeroot (or as root), we cannot make a file unremovable with "chmod a-w .". Detect this case early and skip that test. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Use less memory in "git log"Linus Torvalds2006-04-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This trivially avoids keeping the commit message data around after we don't need it any more, avoiding a continually growing "git log" memory footprint. It's not a huge deal, but it's somewhat noticeable. For the current kernel tree, doing a full "git log" I got - before: /usr/bin/time git log > /dev/null 0.81user 0.02system 0:00.84elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+8851minor)pagefaults 0swaps - after: /usr/bin/time git log > /dev/null 0.79user 0.03system 0:00.83elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+5039minor)pagefaults 0swaps ie the touched pages dropped from 8851 to 5039. For the historic kernel archive, the numbers are 18357->11037 minor page faults. We could/should in theory free the commits themselves, but that's really a lot harder, since during revision traversal we may hit the same commit twice through different children having it as a parent, even after we've shown it once (when that happens, we'll silently ignore it next time, but we still need the "struct commit" to know). And as the commit message data is clearly the biggest part of the commit, this is the really easy 60% solution. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* git-log: do not output excess blank line between commitsJunio C Hamano2006-04-131-1/+1
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* Makefile: $(MAKE) check-docsJunio C Hamano2006-04-131-0/+20
| | | | | | | | | | | | | | This target lists undocumented commands, and/or whose document is not referenced from the main git documentation. For now, there are some exceptions I added primarily because I lack the energy to document them myself: - merge backends (we should really document them) - ssh-push/ssh-pull (does anybody still use them?) - annotate and blame (maybe after one of them eats the other ;-) Signed-off-by: Junio C Hamano <junkio@cox.net>
* Documentation: add a couple of missing docs.Junio C Hamano2006-04-133-0/+93
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'jc/combine' into nextJunio C Hamano2006-04-125-60/+24
|\ | | | | | | | | | | | | | | | | * jc/combine: stripspace: make sure not to leave an incomplete line. git-commit: do not muck with commit message when no_edit is set. When showing a commit message, do not lose an incomplete line. Retire t5501-old-fetch-and-upload test. combine-diff: type fix.
| * Merge branch 'master' into jc/combineJunio C Hamano2006-04-124-58/+22
| |\ | | | | | | | | | | | | | | | | | | | | | * master: stripspace: make sure not to leave an incomplete line. git-commit: do not muck with commit message when no_edit is set. When showing a commit message, do not lose an incomplete line. Retire t5501-old-fetch-and-upload test.
| | * stripspace: make sure not to leave an incomplete line.Junio C Hamano2006-04-121-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When dealing with a commit log message for human consumption, it never makes sense to keep a log that ends with an incomplete line, so make it a part of the clean-up process done by git-stripspace. Acked-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
| | * git-commit: do not muck with commit message when no_edit is set.Junio C Hamano2006-04-121-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Spotted by Linus and Darrin Thompson. When we took a commit message from -F <file> with an incomplete line, we appended "git status" output, which ended up attaching a lone "#" at the end. We still need the "do we have anything to commit?" check by running "status" (which has to know what to do in different cases with -i/-o/-a), but there is no point appending its output to the proposed commit message given by the user. Signed-off-by: Junio C Hamano <junkio@cox.net>
| | * When showing a commit message, do not lose an incomplete line.Linus Torvalds2006-04-121-2/+2
| | |
| | * Retire t5501-old-fetch-and-upload test.Junio C Hamano2006-04-111-48/+0
| | | | | | | | | | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | combine-diff: type fix.Junio C Hamano2006-04-121-2/+2
| | | | | | | | | | | | | | | | | | | | | The variable hunk_end points at a line number, which is represented as unsigned long by all the other variables. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | | Merge branch 'jc/combine' into nextJunio C Hamano2006-04-111-26/+37
|\ \ \ | |/ / | | | | | | | | | | | | * jc/combine: combine-diff: fix hunks at the end (take #2). combine-diff: do not lose hunks with only deletion at end.
| * | combine-diff: fix hunks at the end (take #2).Junio C Hamano2006-04-111-28/+21
| | | | | | | | | | | | | | | | | | | | | The previous round showed the delete-only hunks at the end, but forgot to mark them interesting when they were. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | combine-diff: do not lose hunks with only deletion at end.Junio C Hamano2006-04-111-11/+29
| |/ | | | | | | | | | | | | | | We used to lose hunks that appear at the end and have only deletion. This makes sure that the record beyond the end of file (which holds such deletions) is examined. Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Merge branch 'jc/diff' into nextJunio C Hamano2006-04-119-47/+77
|\ \ | | | | | | | | | | | | | | | | | | * jc/diff: blame and friends: adjust to multiple pathspec change. git log --full-diff tree-diff: do not assume we use only one pathspec
| * | blame and friends: adjust to multiple pathspec change.Junio C Hamano2006-04-106-23/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes things that include revision.h build again. Blame is also built, but I am not sure how well it works (or how well it worked to begin with) -- it was relying on tree-diff to be using whatever pathspec was used the last time, which smells a bit suspicious. Signed-off-by: Junio C Hamano <junkio@cox.net>
| * | git log --full-diffJunio C Hamano2006-04-101-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | Without this flag, "git log -p paths..." shows commits that touch the specified paths, and diffs about the same specified paths. With this, the full diff is shown for commits that touch the specified paths. Signed-off-by: Junio C Hamano <junkio@cox.net>