aboutsummaryrefslogtreecommitdiff
path: root/t
Commit message (Collapse)AuthorAge
* clone: Add an option to set up a mirrorJohannes Schindelin2008-08-02
| | | | | | | | | | | | | | The command line $ git clone --mirror $URL is now a short-hand for $ git clone --bare $URL $ (cd $(basename $URL) && git remote add --mirror origin $URL) Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Compact commit template messageJeff King2008-07-31
| | | | | | | | | | | | | | | We recently let the user know explicitly that an empty commit message will abort the commit. However, this adds yet another line to the template; let's rephrase and re-wrap so that this fits back on two lines. This patch also makes the "fatal: empty commit message?" warning a bit less scary, since this is now a "feature" instead of an error. However, we retain the non-zero exit status to indicate to callers that nothing was committed. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Fix test-parse-options "integer" testJunio C Hamano2008-07-30
| | | | | | | | | | OPT_INTEGER() works on an integer, not on an unsigned long. On a big endian architecture with long larger than int, integer test gives bogus results because of this bug. Reported by H.Merijn Brand in HP-UX 64-bit environment. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Advertise the ability to abort a commitAnders Melchiorsen2008-07-30
| | | | | | | This treats aborting a commit more like a feature. Signed-off-by: Anders Melchiorsen <mail@cup.kalibalik.dk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Support copy and rename detection in fast-export.Alexander Gavrilov2008-07-29
| | | | | | | | | | | | Although it does not matter for Git itself, tools that export to systems that explicitly track copies and renames can benefit from such information. This patch makes fast-export output correct action logs when -M or -C are enabled. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* format-patch: Produce better output with --inline or --attachKevin Ballard2008-07-29
| | | | | | | | | | | | | | | | | | | | This patch makes two small changes to improve the output of --inline and --attach. The first is to write a newline preceding the boundary. This is needed because MIME defines the encapsulation boundary as including the preceding CRLF (or in this case, just LF), so we should be writing one. Without this, the last newline in the pre-diff content is consumed instead. The second change is to always write the line termination character (default: newline) even when using --inline or --attach. This is simply to improve the aesthetics of the resulting message. When using --inline an email client should render the resulting message identically to the non-inline version. And when using --attach this adds a blank line preceding the attachment in the email, which is visually attractive. Signed-off-by: Kevin Ballard <kevin@sb.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t7001: fix "git mv" testJunio C Hamano2008-07-28
| | | | | | | | | | | | The test assumed that we can keep the cached stat information fresh across rename(2); many filesystems however update st_ctime (and POSIX allows them to do so), and that assumption does not hold. We can explicitly refresh the index for the purpose of these tests. The only thing we are interested in is the staged contents and the mode bits are preserved across "git mv". Signed-off-by: Junio C Hamano <gitster@pobox.com>
* init: handle empty "template" parameterJeff King2008-07-27
| | | | | | | | | | | | | | If a user passes "--template=", then our template parameter is blank. Unfortunately, copy_templates() assumes it has at least one character, and does all sorts of bad things like reading from template[-1] and then proceeding to link all of '/' into the .git directory. This patch just checks for that condition in copy_templates and aborts. As a side effect, this means that --template= now has the meaning "don't copy any templates." Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-mv: Keep moved index entries inactPetr Baudis2008-07-27
| | | | | | | | | | | | | | | | | | | | | | | | The rewrite of git-mv from a shell script to a builtin was perhaps a little too straightforward: the git add and git rm queues were emulated directly, which resulted in a rather complicated code and caused an inconsistent behaviour when moving dirty index entries; git mv would update the entry based on working tree state, except in case of overwrites, where the new entry would still have sha1 of the old file. This patch introduces rename_index_entry_at() into the index toolkit, which will rename an entry while removing any entries the new entry might render duplicate. This is then used in git mv instead of all the file queues, resulting in a major simplification of the code and an inevitable change in git mv -n output format. Also the code used to refuse renaming overwriting symlink with a regular file and vice versa; there is no need for that. A few new tests have been added to the testsuite to reflect this change. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* rev-parse: Add support for the ^! and ^@ syntaxBjörn Steinbrink2008-07-27
| | | | | | | | | | | Those shorthands are explained in the rev-parse documentation but were not actually supported by rev-parse itself. gitk internally uses rev-parse to interpret its command line arguments, and being able to use these "limit with parents" syntax is handy there. Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* make sure parsed wildcard refspec ends with slashJunio C Hamano2008-07-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | A wildcard refspec is internally parsed into a refspec structure with src and dst strings. Many parts of the code assumed that these do not include the trailing "/*" when matching the wildcard pattern with an actual ref we see at the remote. What this meant was that we needed to make sure not just that the prefix matched, and also that a slash followed the part that matched. But a codepath that scans the result from ls-remote and finds matching refs forgot to check the "matching part must be followed by a slash" rule. This resulted in "refs/heads/b1" from the remote side to mistakenly match the source side of "refs/heads/b/*:refs/remotes/b/*" refspec. Worse, the refspec crafted internally by "git-clone", and a hardcoded preparsed refspec that is used to implement "git-fetch --tags", violated this "parsed widcard refspec does not end with slash" rule; simply adding the "matching part must be followed by a slash" rule then would have broken codepaths that use these refspecs. This commit changes the rule to require a trailing slash to parsed wildcard refspecs. IOW, "refs/heads/b/*:refs/remotes/b/*" is parsed as src = "refs/heads/b/" and dst = "refs/remotes/b/". This allows us to simplify the matching logic because we only need to do a prefixcmp() to notice "refs/heads/b/one" matches and "refs/heads/b1" does not. Acked-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t6030 (bisect): work around Mac OS X "ls"Jonathan Nieder2008-07-27
| | | | | | | | | | | t6030-bisect-porcelain.sh relies on "ls" exiting with nonzero status when asked to list nonexistent files. Unfortunately, /bin/ls on Mac OS X 10.3 exits with exit code 0. So look at its output instead. Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu> Acked-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-svn: teach dcommit about svn auto-propsBrad King2008-07-25
| | | | | | | | | | | | | Subversion repositories often require files to have properties such as svn:mime-type and svn:eol-style set when they are added. Users typically set these properties automatically using the SVN auto-props feature with 'svn add'. This commit teaches dcommit to look at the user SVN configuration and apply matching auto-props entries for files added by a diff as it is applied to the SVN remote. Signed-off-by: Brad King <brad.king@kitware.com> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Propagate -u/--upload-pack option of "git clone" to transport.Steve Haslam2008-07-25
| | | | | | | | | | 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>
* Merge branch 'maint'Junio C Hamano2008-07-25
|\ | | | | | | | | | | | | | | * 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-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-25
| | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'ph/checkout'Junio C Hamano2008-07-24
|\ \ | | | | | | | | | | | | | | | * 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-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>
* | | update test case to protect am --skip behaviourOlivier Marin2008-07-24
|/ / | | | | | | | | Signed-off-by: Olivier Marin <dkr@freesurf.fr> 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>
* | 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>
* | 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>
* | 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>
* | 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>
* | 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>
* | 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>
* | 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>
* | Merge branch 'ns/am-abort'Junio C Hamano2008-07-20
|\ \ | | | | | | | | | | | | * ns/am-abort: git am --abort
| * | git am --abortNanako Shiraishi2008-07-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After failing to apply patches in the middle of a series, "git am --abort" lets you go back to the original commit. [jc: doc/help update from Olivier, and fixups for "am -3" squashed in] Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com> Signed-off-by: Olivier Marin <dkr@freesurf.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'jc/add-addremove'Junio C Hamano2008-07-20
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jc/add-addremove: git-add --all: documentation git-add --all: tests git-add --all: add all files builtin-add.c: restructure the code for maintainability Conflicts: builtin-add.c
| * | | git-add --all: testsJunio C Hamano2008-07-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And here is a small test script that makes sure that: - both modified and new files are included, - removed file is noticed, and - no ignored file is included. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | "needs update" considered harmfulJunio C Hamano2008-07-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git update-index --refresh", "git reset" and "git add --refresh" have reported paths that have local modifications as "needs update" since the beginning of git. Although this is logically correct in that you need to update the index at that path before you can commit that change, it is now becoming more and more clear, especially with the continuous push for user friendliness since 1.5.0 series, that the message is suboptimal. After all, the change may be something the user might want to get rid of, and "updating" would be absolutely a wrong thing to do if that is the case. I prepared two alternatives to solve this. Both aim to reword the message to more neutral "locally modified". This patch is a more intrusive variant that changes the message for only Porcelain commands ("add" and "reset") while keeping the plumbing "update-index" intact. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'maint'Junio C Hamano2008-07-20
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | * maint: fix usage string for git grep refresh-index: fix bitmask assignment Conflicts: builtin-grep.c
| * | | refresh-index: fix bitmask assignmentJunio C Hamano2008-07-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5fdeacb (Teach update-index about --ignore-submodules, 2008-05-14) added a new refresh option flag but did not assign a unique bit for it correctly, and broke "update-index --ignore-missing". This fixes it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | builtin-merge.c: Fix option parsingMichele Ballabio2008-07-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now "git merge -m" needs a message, and errors out with the usage text if none is given. This way, t7600-merge.sh is fixed. Signed-off-by: Michele Ballabio <barra_cuda@katamail.com> Acked-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | cvsserver: Add testsuite for packed refsLars Noschinski2008-07-20
| |/ / |/| | | | | | | | | | | | | | | | | Check that req_update shows refs, even if all refs are packed. Signed-off-by: Lars Noschinski <lars@public.noschinski.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'maint'Junio C Hamano2008-07-19
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | * maint: GIT 1.5.6.4 builtin-rm: fix index lock file path http-fetch: do not SEGV after fetching a bad pack idx file rev-list: honor --quiet option api-run-command.txt: typofix
| * | builtin-rm: fix index lock file pathOlivier Marin2008-07-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When hold_locked_index() is called with a relative git_dir and you are outside the work tree, the lock file become relative to the current directory. So when later setup_work_tree() change the current directory it breaks lock file path and commit_locked_index() fails. This patch move index locking code after setup_work_tree() call to make lock file relative to the working tree as it should be and add a test case. Noticed by Nick Andrew. Signed-off-by: Olivier Marin <dkr@freesurf.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Support gitlinks in fast-import.Alexander Gavrilov2008-07-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently fast-import/export cannot be used for repositories with submodules. This patch extends the relevant programs to make them correctly process gitlinks. Links can be represented by two forms of the Modify command: M 160000 SHA1 some/path which sets the link target explicitly, or M 160000 :mark some/path where the mark refers to a commit. The latter form can be used by importing tools to build all submodules simultaneously in one physical repository, and then simply fetch them apart. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | testsuite for cvs co -cFabian Emmes2008-07-19
| | | | | | | | | | | | | | | | | | | | | | | | Check that all branches are displayed. Signed-off-by: Fabian Emmes <fabian.emmes@rwth-aachen.de> Signed-off-by: Lars Noschinski <lars@public.noschinski.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Testsuite: Unset CVS_SERVERFabian Emmes2008-07-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | The CVS_SERVER environment variable can cause some of the cvsimport tests to fail. So unset this variable at the beginning of the test script. Signed-off-by: Fabian Emmes <fabian.emmes@rwth-aachen.de> Signed-off-by: Lars Noschinski <lars@public.noschinski.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | t9001 (send-email): Do not use hardcoded /bin/sh in testJunio C Hamano2008-07-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Scriptlets used form inside this test began with hardcoded "#!/bin/sh". By setting SHELL_PATH the user is already telling us that what the vendor has in /bin/sh isn't POSIX enough, and we really should try to honor that request. Originally noticed by SungHyun Nam who later tested this patch and verified that it fixes the issue on Solaris 9. Signed-off-by: Junio C Hamano <gitster@pobox.com>