summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2006-04-17Log message printout cleanupsLibravatar Linus Torvalds11-185/+151
On Sun, 16 Apr 2006, Junio C Hamano wrote: > > In the mid-term, I am hoping we can drop the generate_header() > callchain _and_ the custom code that formats commit log in-core, > found in cmd_log_wc(). Ok, this was nastier than expected, just because the dependencies between the different log-printing stuff were absolutely _everywhere_, but here's a patch that does exactly that. The patch is not very easy to read, and the "--patch-with-stat" thing is still broken (it does not call the "show_log()" thing properly for merges). That's not a new bug. In the new world order it _should_ do something like if (rev->logopt) show_log(rev, rev->logopt, "---\n"); but it doesn't. I haven't looked at the --with-stat logic, so I left it alone. That said, this patch removes more lines than it adds, and in particular, the "cmd_log_wc()" loop is now a very clean: while ((commit = get_revision(rev)) != NULL) { log_tree_commit(rev, commit); free(commit->buffer); commit->buffer = NULL; } so it doesn't get much prettier than this. All the complexity is entirely hidden in log-tree.c, and any code that needs to flush the log literally just needs to do the "if (rev->logopt) show_log(...)" incantation. I had to make the combined_diff() logic take a "struct rev_info" instead of just a "struct diff_options", but that part is pretty clean. This does change "git whatchanged" from using "diff-tree" as the commit descriptor to "commit", and I changed one of the tests to reflect that new reality. Otherwise everything still passes, and my other tests look fine too. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-17rev-list --header: output format fixLibravatar Junio C Hamano1-0/+3
Initial fix prepared by Johannes, but I did it slightly differently. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-16Fixes for option parsingLibravatar Linus Torvalds2-4/+15
Make sure "git show" always show the header, regardless of whether there is a diff or not. Also, make sure "always_show_header" actually works, since generate_header only tested it in one out of three return paths. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-16log/whatchanged/show - log formatting cleanup.Libravatar Junio C Hamano3-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>
2006-04-16Simplify common default options setup for built-in log family.Libravatar Junio C Hamano1-13/+7
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-16Merge branch 'master' into lt/logoptLibravatar Junio C Hamano8-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.
2006-04-16pager: do not fork a pager if PAGER is set to empty.Libravatar Johannes Schindelin1-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>
2006-04-16Tentative built-in "git show"Libravatar Linus Torvalds3-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>
2006-04-16Built-in git-whatchanged.Libravatar Junio C Hamano1-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>
2006-04-15rev-list option parser fix.Libravatar Junio C Hamano1-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>
2006-04-15Split init_revisions() out of setup_revisions()Libravatar Junio C Hamano5-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>
2006-04-15diff-options: add --patch-with-statLibravatar Johannes Schindelin3-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>
2006-04-15diff-files --stat: do not dump core with unmerged index.Libravatar Junio C Hamano1-4/+17
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-15Support "git cmd --help" syntaxLibravatar Linus Torvalds1-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>
2006-04-15diff --stat: do not do its own three-dashes.Libravatar Junio C Hamano2-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>
2006-04-15diff-tree: typefix.Libravatar Junio C Hamano1-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>
2006-04-14GIT v1.3.0-rc4Libravatar Junio C Hamano1-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>
2006-04-14Merge branch 'dl/xdiff'Libravatar Junio C Hamano2-5/+110
* dl/xdiff: xdiff: post-process hunks to make them consistent.
2006-04-14Fix up rev-list option parsing.Libravatar Junio C Hamano1-2/+4
rev-list does not take diff options, so barf after seeing some. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-14Fix up default abbrev in setup_revisions() argument parser.Libravatar Junio C Hamano3-0/+7
The default abbreviation precision should be DEFAULT_ABBREV as before. Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-14Common option parsing for "git log --diff" and friendsLibravatar Linus Torvalds6-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>
2006-04-14Merge branch 'js/diffstat'Libravatar Junio C Hamano4-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)
2006-04-14Merge branch 'jc/fix5500'Libravatar Junio C Hamano1-19/+14
* jc/fix5500: t5500: test fix
2006-04-14Clean up trailing whitespace when pretty-printing commitsLibravatar Linus Torvalds1-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>
2006-04-14"git cmd -h" for shell scripts.Libravatar Junio C Hamano1-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>
2006-04-14git-log <diff-options> <paths> documentationLibravatar Junio C Hamano1-4/+20
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-14Retire git-log.sh (take #4)Libravatar Junio C Hamano1-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>
2006-04-14stripspace: incomplete line fix (take #2)Libravatar Junio C Hamano1-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>
2006-04-13t5500: test fixLibravatar Junio C Hamano1-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>
2006-04-13diff --stat: no need to ask funcnames nor context.Libravatar Junio C Hamano1-2/+2
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-13Fix-up previous expr changes.Libravatar Junio C Hamano2-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>
2006-04-13diff-options: add --stat (take 2)Libravatar Johannes Schindelin1-5/+5
... and a fix for an invalid free(): Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-13xdiff: post-process hunks to make them consistent.Libravatar Davide Libenzi2-5/+110
2006-04-13diff-options: add --stat (take 2)Libravatar Johannes Schindelin4-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>
2006-04-13Shell utilities: Guard against expr' magic tokens.Libravatar Mark Wooding9-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>
2006-04-13t3600-rm: skip failed-remove test when we cannot make an unremovable file.Libravatar Junio C Hamano1-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>
2006-04-13Use less memory in "git log"Libravatar Linus Torvalds1-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>
2006-04-13git-log: do not output excess blank line between commitsLibravatar Junio C Hamano1-1/+1
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-13Makefile: $(MAKE) check-docsLibravatar Junio C Hamano1-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>
2006-04-13Documentation: add a couple of missing docs.Libravatar Junio C Hamano3-0/+93
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-12Merge branch 'jc/combine' into nextLibravatar Junio C Hamano5-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.
2006-04-12Merge branch 'master' into jc/combineLibravatar Junio C Hamano4-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.
2006-04-12combine-diff: type fix.Libravatar Junio C Hamano1-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>
2006-04-12stripspace: make sure not to leave an incomplete line.Libravatar Junio C Hamano1-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>
2006-04-12git-commit: do not muck with commit message when no_edit is set.Libravatar Junio C Hamano1-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>
2006-04-12When showing a commit message, do not lose an incomplete line.Libravatar Linus Torvalds1-2/+2
2006-04-11Retire t5501-old-fetch-and-upload test.Libravatar Junio C Hamano1-48/+0
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-11Merge branch 'jc/combine' into nextLibravatar Junio C Hamano1-26/+37
* jc/combine: combine-diff: fix hunks at the end (take #2). combine-diff: do not lose hunks with only deletion at end.
2006-04-11Merge branch 'jc/diff' into nextLibravatar Junio C Hamano9-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
2006-04-11combine-diff: fix hunks at the end (take #2).Libravatar Junio C Hamano1-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>