aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* git-checkout: improve error messages, detect ambiguities.Pierre Habouzit2008-07-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch is twofold: it moves the option consistency checks just under the parse_options call so that it doesn't get in the way of the tree reference vs. pathspecs desambiguation. The other part rewrites the way to understand arguments so that when git-checkout fails it does with an understandable message. Compared to the previous behavior we now have: - a better error message when doing: git checkout <blob reference> -- now complains about the reference not pointing to a tree, instead of things like: error: pathspec <blob reference> did not match any file(s) known to git. error: pathspec '--' did not match any file(s) known to git. - a better error message when doing: git checkout <path> -- It now complains about <path> not being a reference instead of the completely obscure: error: pathspec '--' did not match any file(s) known to git. - an error when -- wasn't used, and the first argument is ambiguous (i.e. can be interpreted as both ref and as path). Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'maint' into ph/checkoutJunio C Hamano2008-07-23
|\ | | | | | | | | * maint: git-checkout: fix command line parsing.
| * git-checkout: fix command line parsing.Pierre Habouzit2008-07-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes an issue when you use: $ git checkout -- <path1> [<paths>...] and that <path1> can also be understood as a reference. git-checkout mistakenly understands this as the same as: $ git checkout <path1> -- [<paths>...] because parse-options was eating the '--' and the argument parser thought he was parsing: $ git checkout <path1> [<paths>...] Where there indeed is an ambiguity Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Make non-static functions, that may be static, staticStephan Beyer2008-07-23
| | | | | | | | | | Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | ignore non-existent refs in dwim_log()Junio C Hamano2008-07-23
| | | | | | | | | | | | | | | | | | | | | | f2eba66 (Enable HEAD@{...} and make it independent from the current branch, 2007-02-03) introduced dwim_log() to handle <refname>@{...} syntax, and as part of its processing, it checks if the ref exists by calling refsolve_ref(). It should call it as a reader to make sure the call returns NULL for a nonexistent ref (not as a potential writer in which case it does not return NULL). Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-completion.bash: provide completion for 'show-branch'Thomas Rast2008-07-23
| | | | | | | | | | | | | | | | It previously used the same as 'log', but the options are quite different and the arguments must be single refs (or globs). Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | bash completion: Add long options for 'git rm'Lee Marlow2008-07-23
| | | | | | | | | | | | | | Options added: --cached --dry-run --ignore-unmatch --quiet Signed-off-by: Lee Marlow <lee.marlow@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | svnimport: newer libsvn wants us to ask for the root with "", not "/"P. Christeas2008-07-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In r27729, libsvn introduced an assert which explicitly forbids searching the tree at "/". Luckily enough, it still accepts an empty string "" as the starting point. http://svn.collab.net/viewvc/svn/trunk/subversion/libsvn_ra/ra_loader.c?r1=27653&r2=27729 Tested against libsvn0-1.5.0-4mdv2009.0 (needs the fix), libsvn0-1.4.6-5mdv2008.1 (works anyway) Signed-off-by: P. Christeas <p_christ@hol.gr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Documentation/git-filter-branch: teach "rm" instead of "update-index --remove"Petr Baudis2008-07-23
| | | | | | | | | | | | | | | | | | The example to remove paths using index-filter was done with "git update-index --remove"; "git rm --cached" would be more familiar to new people and is sufficient for this particular case. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git daemon: avoid waking up too oftenJohannes Schindelin2008-07-23
| | | | | | | | | | | | | | | | | | | | | | | | To avoid waking up unnecessarily, a pipe is set up that is only ever written to by child_handler(), when a child disconnects, as suggested per Junio. This avoids waking up the main process every second to see if a child was disconnected. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | builtin-commit: Two trivial style-cleanupsJohannes Schindelin2008-07-23
| | | | | | | | | | | | | | | | Pierre Habouzit noticed that two variables were not static which should have been, and that adding "\n\n" is better than adding '\n' twice. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Documentation: clarify diff --ccJunio C Hamano2008-07-23
| | | | | | | | | | | | The definition of an "uninteresting" hunk was not in line with reality. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | am --abort: Add to bash-completion and mention in git-rerere documentationStephan Beyer2008-07-23
| | | | | | | | | | | | | | | | | | The git-rerere documentation talks about commands that invoke "git rerere clear" automatically. git am --abort is added and a typo is fixed additionally. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-filter-branch.sh: Allow running in bare repositoriesPetr Baudis2008-07-23
| | | | | | | | | | | | | | | | | | | | Commit 46eb449c restricted git-filter-branch to non-bare repositories unnecessarily; git-filter-branch can work on bare repositories just fine. Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | builtin-branch.c: optimize --merged and --no-mergedJunio C Hamano2008-07-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git branch --no-merged $commit" used to compute the merge base between the tip of each and every branch with the named $commit, but this was wasteful when you have many branches. Inside append_ref() we literally ran has_commit() between the tip of the branch and the merge_filter_ref. Instead, we can let the revision machinery traverse the history as if we are running: $ git rev-list --branches --not $commit by queueing the tips of branches we encounter as positive refs (this mimicks the "--branches" option in the above command line) and then appending the merge_filter_ref commit as a negative one, and finally calling prepare_revision_walk() to limit the list.. After the traversal is done, branch tips that are reachable from $commit are painted UNINTERESTING; they are already fully contained in $commit (i.e. --merged). Tips that are not painted UNINTERESTING still have commits that are not reachable from $commit, thus "--no-merged" will show them. With an artificial repository that has "master" and 1000 test-$i branches where they were created by "git branch test-$i master~$i": (with patch) $ /usr/bin/time git-branch --no-merged master >/dev/null 0.12user 0.02system 0:00.15elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+1588minor)pagefaults 0swaps $ /usr/bin/time git-branch --no-merged test-200 >/dev/null 0.15user 0.03system 0:00.18elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+1711minor)pagefaults 0swaps (without patch) $ /usr/bin/time git-branch --no-merged master >/dev/null 0.69user 0.03system 0:00.72elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+2229minor)pagefaults 0swaps $ /usr/bin/time git-branch --no-merged test-200 >/dev/null 0.58user 0.03system 0:00.61elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+2248minor)pagefaults 0swaps Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | builtin-branch.c: remove unused code in append_ref() callback functionJunio C Hamano2008-07-23
| | | | | | | | | | | | | | We let for_each_ref() to feed all refs to append_ref() but we are only ever interested in local or remote tracking branches. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | stash save: fix parameter handlingJunio C Hamano2008-07-23
| | | | | | | | | | | | | | A command line "git stash save --keep-index I was doing this" was misparsed and keep-index codepath did not trigger. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-am: Add colon before the subject that is printed out as being appliedStephan Beyer2008-07-23
| | | | | | | | | | | | | | | | | | git-am output can be confusing, because the subject of the applied patch can look like the rest of a sentence starting with "Applying". The added colon should make this clearer. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | rebase -i: When an 'edit' stops, mention the commitJohannes Sixt2008-07-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a rebase session where more than one commit is to be 'edit'ed, and the user spends considerable time to 'edit' a commit, it is easy to forget what one wanted to 'edit' at the individual commits. It would be helpful to see at which commit the rebase stopped. Incidentally, if the rebase stopped due to merge conflicts or other errors, the commit was already reported ("Could not apply $sha1..."), but when rebase stopped after successfully applying an "edit" commit, it would not mention it. With this change the commit is reported. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | sort_in_topological_order(): avoid setting a commit flagJohannes Schindelin2008-07-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to set the TOPOSORT flag of commits during the topological sorting, but we can just as well use the member "indegree" for it: indegree is now incremented by 1 in the cases where the commit used to have the TOPOSORT flag. This is the same behavior as before, since indegree could not be non-zero when TOPOSORT was unset. Incidentally, this fixes the bug in show-branch where the 8th column was not shown: show-branch sorts the commits in topological order, assuming that all the commit flags are available for show-branch's private matters. But this was not true: TOPOSORT was identical to the flag corresponding to the 8th ref. So the flags for the 8th column were unset by the topological sorting. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Add test to show that show-branch misses out the 8th columnJohannes Schindelin2008-07-23
| | | | | | | | | | | | | | Noticed by Pasky. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Ignore dirty submodule states in "git pull --rebase"Johannes Schindelin2008-07-23
| | | | | | | | | | | | | | | | This is a companion patch to 6848d58c(Ignore dirty submodule states during rebase and stash). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | t/t4202-log.sh: add newline at end of fileBrandon Casey2008-07-23
| | | | | | | | | | | | | | | | Some shells hang when parsing the script if the last statement is not followed by a newline. So add one. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | t7502-commit.sh: rearrange test to make more portableBrandon Casey2008-07-23
| | | | | | | | | | | | | | | | | | Some shells have problems with one-shot environment variable export and function calls. The sequence is rearranged to avoid the one-shot and to allow the test script to be linked together with '&&'. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | t3200,t7201: replace '!' with test_must_failBrandon Casey2008-07-23
| | | | | | | | | | Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | t4116-apply-reverse.sh: use $TAR rather than tarBrandon Casey2008-07-23
| | | | | | | | | | Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | t/: Replace diff [-u|-U0] with test_cmp to allow compilation with old diffBrandon Casey2008-07-23
| | | | | | | | | | Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | t7601: extend the 'merge picks up the best result' testMiklos Vajna2008-07-23
| | | | | | | | | | | | | | | | | | The test only checked if the best result picking code works if there are multiple strategies set in the config. Add a similar one that tests if the same true if the -s option of git merge was used multiple times. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | In perforce, RCS keywords are case-sensitiveDaniel Barkalow2008-07-23
| | | | | | | | | | | | | | At least, this is true in 2007.2, according to the documentation. Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Allow pager of diff command be enabled/disabledAlex Riesen2008-07-23
| | | | | | | | | | | | | | | | | | See for example, status and show commands. Besides, Documentation/RelNotes-1.6.0.txt mentions that pager.<cmd> can be used to enable/disable paging behavior per command. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Fix two leftovers from path_list->string_listJohannes Schindelin2008-07-22
| | | | | | | | | | | | | | | | In the documentation, where you cannot get compile errors for using the wrong member name, there were two mentions of 'path' left. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git am --skip: clean the index while preserving local changesOlivier Marin2008-07-22
| | | | | | | | | | | | | | | | | | | | | | | | In 3-way merge, "am" will let the index with unmerged path waiting for us to resolve conflicts and continue. But if we want to --skip instead, "am" refuses to continue because of the dirty index. With this patch, "am" will clean the index without touching files locally modified, before continuing. Signed-off-by: Olivier Marin <dkr@freesurf.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-submodule: move ill placed shift.Pierre Habouzit2008-07-21
| | | | | | | | | | | | | | | | | | | | When running git submodule update -i, the "-i" is shifted before recursing into cmd_init and then again outside of the loop. This causes some /bin/sh to complain about shifting when there are no arguments left (and would discard anything written after -i too). Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | builtin-merge: add missing structure initializationPierre Habouzit2008-07-21
| | | | | | | | | | | | | | | | The parameter that is eventually passed to read_directory() to scan the working tree should be properly initialized. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | builtin-merge: give a proper error message for invalid strategies in configMiklos Vajna2008-07-21
| | | | | | | | | | | | | | | | | | | | 'git merge -s foobar' diagnosed invalid "foobar" strategy and errored out with a message, but foobar in pull.twohead or pull.octopus was just silently ignored. This makes invalid strategy both on the command line and in the configuration file to trigger the same error. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | tests: do not rely on external "patch"Junio C Hamano2008-07-21
| | | | | | | | | | | | | | | | | | | | Some of our tests assumed a working "patch" command to produce expected results when checking "git-apply", but some systems have broken "patch". We can compare our output with expected output that is precomputed instead to sidestep this issue. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Don't cut off last character of commit descriptions.Nikolaj Schumacher2008-07-21
| | | | | | | | | | | | | | | | | | | | This should have been part of 24a2293 (git-blame.el: show the when, who and what in the minibuffer., 2008-02-12), that changed from using --pretty=oneline to --pretty=format:... without terminating newline. Acked-by: David Kågedal <davidk@lysator.liu.se> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | parse-options: fix segmentation fault when a required value is missingOlivier Marin2008-07-21
| | | | | | | | | | | | | | | | | | | | p->argc represent the number of arguments that have not been parsed yet, _including_ the one we are currently parsing. If it is not greater than one then there is no more argument. Signed-off-by: Olivier Marin <dkr@freesurf.fr> Acked-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | mailinfo: better parse email adresses containg parenthesesPhilippe Bruhat (BooK)2008-07-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using git-rebase, author fields containing a ')' at the last position had the close-parens character removed; the removal should be done only when it is of this form: user@host (User Name) i.e. the remainder after stripping the e-mail address part is enclosed in a parentheses pair as a whole, not for addresses like this: User Name (me) <user@host> Signed-off-by: Philippe Bruhat (BooK) <book@cpan.org> Acked-by: Lukas Sandström <lukass@etek.chalmers.se> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-am: remove dash from help messageOlivier Marin2008-07-21
| | | | | | | | | | Signed-off-by: Olivier Marin <dkr@freesurf.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Revert "make git-status use a pager"Junio C Hamano2008-07-21
| | | | | | | | | | | | | | This reverts commit c8af1de9cfa0a5678ae766777e0f905e60b69fda. The change was immensely unpopular, and poeple who would really want to page can use pager.status configuration.
* | git-diff(1): "--c" -> "--cc" typo fixJonathan Nieder2008-07-21
| | | | | | | | | | | | | | git diff does not take a --c option. Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Rename path_list to string_listJohannes Schindelin2008-07-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The name path_list was correct for the first usage of that data structure, but it really is a general-purpose string list. $ perl -i -pe 's/path-list/string-list/g' $(git grep -l path-list) $ perl -i -pe 's/path_list/string_list/g' $(git grep -l path_list) $ git mv path-list.h string-list.h $ git mv path-list.c string-list.c $ perl -i -pe 's/has_path/has_string/g' $(git grep -l has_path) $ perl -i -pe 's/path/string/g' string-list.[ch] $ git mv Documentation/technical/api-path-list.txt \ Documentation/technical/api-string-list.txt $ perl -i -pe 's/strdup_paths/strdup_strings/g' $(git grep -l strdup_paths) ... and then fix all users of string-list to access the member "string" instead of "path". Documentation/technical/api-string-list.txt needed some rewrapping, too. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Rename .git/rebase to .git/rebase-applyJohannes Schindelin2008-07-21
| | | | | | | | | | | | | | | | | | | | With git-am, it sounds awkward to have the patches in ".git/rebase/", but for technical reasons, we have to keep the same directory name for git-am and git-rebase. ".git/rebase-apply" seems to be a good compromise. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Update my e-mail addressJunio C Hamano2008-07-21
| | | | | | | | | | | | The old cox.net address is still getting mails from gitters. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'ap/trackinfo'v1.6.0-rc0Junio C Hamano2008-07-20
|\ \ | | | | | | | | | | | | * ap/trackinfo: Reword "your branch has diverged..." lines to reduce line length
| * | Reword "your branch has diverged..." lines to reduce line lengthAvery Pennarun2008-07-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The message length depends on the length of the branch name. In my case, the branch name "origin/add-chickens2" put the first line of the "your branch has diverged" message over 80 characters, which triggered "less -FS" to not exit automatically as expected. This patch rewords the messages to make the lines generally shorter, so that you'd need a significantly longer branch name to trigger the problem. Signed-off-by: Avery Pennarun <apenwarr@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'jc/rerere-auto-more'Junio C Hamano2008-07-20
|\ \ \ | | | | | | | | | | | | | | | | * jc/rerere-auto-more: rerere.autoupdate: change the message when autoupdate is in effect
| * | | rerere.autoupdate: change the message when autoupdate is in effectJunio C Hamano2008-07-16
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the message rerere issues after reusing previous conflict resolution from "Resolved" to "Staged" when autoupdate option is in effect. It is envisioned that in practice, some auto resolitions are trickier and iffier than others, and we would want to add a feature to mark individual resolutions as "this is ok to autoupdate" or "do not autoupdate the result using this resolution even when rerere.autoupdate is in effect" in the future. When that happens, these messages will make the distinction clearer. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'ns/am-abort'Junio C Hamano2008-07-20
|\ \ \ | | | | | | | | | | | | | | | | * ns/am-abort: git am --abort