summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* archive: declare struct archiver where it's neededRene Scharfe2008-07-252-7/+5
| | | | | | | | Move the declaration of struct archiver to archive.c, as this is the only file left where it is used. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* archive: define MAX_ARGS where it's neededRene Scharfe2008-07-252-4/+2
| | | | | | | | | MAX_EXTRA_ARGS is not used anymore, so remove it. MAX_ARGS is used only in builtin-upload-archive.c, so define it there. Also report the actual value we're comparing against when the number of args is too big. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* archive: move parameter parsing code to archive.cRene Scharfe2008-07-253-145/+137
| | | | | | | | | | | write_archive() in archive.c is the only callsite for the command line parsing functions located in builtin-archive.c. Move them to the place where they are used, un-export them and make them static, as hinted at by Stephan. Cc: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* archive: add write_archive()Rene Scharfe2008-07-254-21/+21
| | | | | | | | | Both archive and upload-archive have to parse command line arguments and then call the archiver specific write function. Move the duplicate code to a new function, write_archive(). Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Remove references to git-fetch-pack from "git clone" documentation.Steve Haslam2008-07-251-5/+4
| | | | | | | | | "git clone" no longer calls "git-fetch-pack", so the documentation is a bit stale. Instead, state that the -u option is to be used when accessing a repository over ssh. Signed-off-by: Steve Haslam <shaslam@lastminute.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-am: Mention --abort in usage string part of OPTIONS_SPECStephan Beyer2008-07-251-2/+1
| | | | | | | | | The three separate lines for --skip, --resolved and --abort are merged into one so that it is easy to see that they're alternative and related options. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Propagate -u/--upload-pack option of "git clone" to transport.Steve Haslam2008-07-252-0/+30
| | | | | | | | | | The -u option to override the remote system's path to git-upload-pack was being ignored by "git clone"; caused by a missing call to transport_set_option to set TRANS_OPT_UPLOADPACK. Presumably this crept in when git-clone was converted from shell to C. Signed-off-by: Steve Haslam <shaslam@lastminute.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* editor.c: Libify launch_editor()Stephan Beyer2008-07-254-15/+23
| | | | | | | | | This patch removes exit()/die() calls and builtin-specific messages from launch_editor(), so that it can be used as a general libgit.a function to launch an editor. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Move launch_editor() from builtin-tag.c to editor.cStephan Beyer2008-07-253-53/+57
| | | | | | | | | launch_editor() is declared in strbuf.h but defined in builtin-tag.c. This patch moves launch_editor() into a new source file editor.c, but keeps the declaration in strbuf.h. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'maint'Junio C Hamano2008-07-254-8/+15
|\ | | | | | | | | | | | | | | * maint: Makefile: fix shell quoting tests: propagate $(TAR) down from the toplevel Makefile index-pack.c: correctly initialize appended objects send-email: find body-encoding correctly
| * Makefile: fix shell quotingJunio C Hamano2008-07-252-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makefile records paths to a few programs in GIT-BUILD-OPTIONS file. These paths need to be quoted twice: once to protect specials from the shell that runs the generated GIT-BUILD-OPTIONS file, and again to protect them (and the first level of quoting itself) from the shell that runs the "echo" inside the Makefile. You can test this by trying: $ ln -s /bin/tar "$HOME/Tes' program/tar" $ make TAR="$HOME/Tes' program/tar" test Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * tests: propagate $(TAR) down from the toplevel MakefileJunio C Hamano2008-07-252-1/+1
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * index-pack.c: correctly initialize appended objectsBjörn Steinbrink2008-07-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When index-pack completes a thin pack it appends objects to the pack. Since the commit 92392b4(index-pack: Honor core.deltaBaseCacheLimit when resolving deltas) such an object can be pruned in case of memory pressure, and will be read back again by get_data_from_pack(). For this to work, the fields in object_entry structure need to be initialized properly. Noticed by Pierre Habouzit. Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de> Acked-by: Nicolas Pitre <nico@cam.org> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * send-email: find body-encoding correctlyPeter Valdemar Mørch2008-07-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | In 8291db6 (git-send-email: add charset header if we add encoded 'From', 2007-11-16), "$1" is used from a regexp without using () to capture anything in $1. Later, when that value was used, it causes a warning about a variable being undefined, instead of using the correct value for comparison (not that it makes difference in the current code that does not do actual re-encoding). Signed-off-by: Peter Valdemar Mørch <peter@morch.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Documentation: clarify how to disable elements in core.whitespaceJunio C Hamano2008-07-251-1/+2
| | | | | | | | | | | | Noticed by Peter Valdemar Mørch. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | document that git-tag can tag more than headsJonathan Nieder2008-07-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | After looking the git-tag manpage, someone on #git wondered how to tag a commit that is not a branch head. This patch changes the synopsis to say "<commit> | <object>" instead of "<head>" to address his question. Samuel Bronson had the idea of putting "<commit> | <object>" for "<object>" because most tags point to commits (and for the rest of the manpage, all tags point to commits). Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | perl/Makefile: update NO_PERL_MAKEMAKER sectionBrandon Casey2008-07-251-4/+9
| | | | | | | | | | | | | | | | The perl modules must be copied to blib/lib so they are available for testing. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | bash: offer only paths after '--' for 'git checkout'SZEDER Gábor2008-07-241-0/+2
| | | | | | | | | | | | | | | | Commit d773c631 (bash: offer only paths after '--', 2008-07-08) did the same for several other git commands, but 'git checkout' went unnoticed. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | checkout: mention '--' in the docsSZEDER Gábor2008-07-241-1/+1
| | | | | | | | | | | | | | | | 'git checkout' uses '--' to separate options from paths, but it was not mentioned in the documentation Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'ph/checkout'Junio C Hamano2008-07-242-18/+117
|\ \ | | | | | | | | | | | | | | | * ph/checkout: git-checkout: improve error messages, detect ambiguities. git-checkout: fix command line parsing.
| * | git-checkout: improve error messages, detect ambiguities.Pierre Habouzit2008-07-242-17/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-231-1/+2
| |\ \ | | |/ | | | | | | | | | * maint: git-checkout: fix command line parsing.
| | * git-checkout: fix command line parsing.Pierre Habouzit2008-07-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | update test case to protect am --skip behaviourOlivier Marin2008-07-241-0/+2
| | | | | | | | | | | | | | | Signed-off-by: Olivier Marin <dkr@freesurf.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Teach fsck and prune about the new location of temporary objectsBrandon Casey2008-07-242-17/+28
|/ / | | | | | | | | | | | | | | | | Since 5723fe7e, temporary objects are now created in their final destination directories, rather than in .git/objects/. Teach fsck to recognize and ignore the temporary objects it encounters, and teach prune to remove them. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Make non-static functions, that may be static, staticStephan Beyer2008-07-234-4/+4
| | | | | | | | | | 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-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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-231-1/+17
| | | | | | | | | | | | | | | | 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-231-0/+15
| | | | | | | | | | | | | | 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-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-231-1/+1
| | | | | | | | | | | | | | | | | | 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-231-14/+11
| | | | | | | | | | | | | | | | | | | | | | | | 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-231-4/+3
| | | | | | | | | | | | | | | | 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-232-8/+8
| | | | | | | | | | | | 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-232-2/+2
| | | | | | | | | | | | | | | | | | 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-232-14/+26
| | | | | | | | | | | | | | | | | | | | 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-231-21/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "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-231-7/+3
| | | | | | | | | | | | | | 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-231-2/+2
| | | | | | | | | | | | | | 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-232-2/+2
| | | | | | | | | | | | | | | | | | 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-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-233-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-231-0/+59
| | | | | | | | | | | | | | 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-231-3/+3
| | | | | | | | | | | | | | | | 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-231-1/+2
| | | | | | | | | | | | | | | | 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-231-3/+5
| | | | | | | | | | | | | | | | | | 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-232-2/+2
| | | | | | | | | | 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-231-2/+2
| | | | | | | | | | 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-233-12/+12
| | | | | | | | | | 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-231-0/+15
| | | | | | | | | | | | | | | | | | 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>