summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)Author
2008-08-06Sync with 1.5.6.5Junio C Hamano
2008-08-06Files given on the command line are relative to $cwdJunio C Hamano
When running "git commit -F file" and "git tag -F file" from a subdirectory, we should take it as relative to the directory we started from, not relative to the top-level directory. This adds a helper function "parse_options_fix_filename()" to make it more convenient to fix this class of issues. Ideally, parse_options() should support a new type of option, "OPT_FILENAME", to do this uniformly, but this patch is meant to go to 'maint' to fix it minimally. One thing to note is that value for "commit template file" that comes from the command line is taken as relative to $cwd just like other parameters, but when it comes from the configuration varilable 'commit.template', it is taken as relative to the working tree root as before. I think this difference actually is sensible (not that I particularly think commit.template itself is sensible). Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-06t9119: conditionally re-enable test depending on svn(1) versionEric Wong
I've tested this with svn 1.4.4 This also adds quoting to make it work odd characters in the trash path. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-06Fix race condition in t9119-git-svn-info.shDavid D. Kilzer
Changed the ptouch bash function to use the "Text Last Updated" date reported by 'svn info' when changing the modified time (mtime) of the file/symlink/directory in the git working directory. Previously it used the mtime of the item in the svn working directory, which caused the race condition. [ew: swapped argument order of ptouch() to minimize diff] From: David D. Kilzer <ddkilzer@kilzer.net> Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-05correct access right for git-svn-dcommit testDmitry Potapov
The tests requires anonymous write access. Therefore, "anon-access = write" is added to conf/svnserve.conf. But because it was added to the end of the file, it is impossible to guarantee in what section it will be located. It turned out that on SVN 1.5, it was placed in the wrong section and as result the test failed. Signed-off-by: Dmitry Potapov <dpotapov@gmail.com> Tested-by: Brad King <brad.king@kitware.com> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-04Flush output in start_asyncAnders Melchiorsen
This prevents double output in case stdout is redirected. Signed-off-by: Anders Melchiorsen <mail@cup.kalibalik.dk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-03clone --bare: Add ".git" suffix to the directory name to clone intoJohannes Schindelin
We have a tradition that bare repositories live in directories ending in ".git". To make this more a convention than just a tradition, teach "git clone --bare" to add a ".git" suffix to the directory name. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-08-02clone: Add an option to set up a mirrorJohannes Schindelin
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>
2008-08-02t/t4202-log.sh: add newline at end of fileBrandon Casey
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>
2008-08-02sort_in_topological_order(): avoid setting a commit flagJohannes Schindelin
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>
2008-08-02Propagate -u/--upload-pack option of "git clone" to transport.Steve Haslam
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>
2008-08-02make sure parsed wildcard refspec ends with slashJunio C Hamano
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>
2008-08-02init: handle empty "template" parameterJeff King
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>
2008-07-31Compact commit template messageJeff King
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>
2008-07-30Fix test-parse-options "integer" testJunio C Hamano
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>
2008-07-30Advertise the ability to abort a commitAnders Melchiorsen
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>
2008-07-30Support copy and rename detection in fast-export.Alexander Gavrilov
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>
2008-07-30format-patch: Produce better output with --inline or --attachKevin Ballard
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>
2008-07-29t7001: fix "git mv" testJunio C Hamano
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>
2008-07-28init: handle empty "template" parameterJeff King
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>
2008-07-27git-mv: Keep moved index entries inactPetr Baudis
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>
2008-07-27rev-parse: Add support for the ^! and ^@ syntaxBjörn Steinbrink
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>
2008-07-27make sure parsed wildcard refspec ends with slashJunio C Hamano
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>
2008-07-27t6030 (bisect): work around Mac OS X "ls"Jonathan Nieder
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>
2008-07-26git-svn: teach dcommit about svn auto-propsBrad King
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>
2008-07-26Propagate -u/--upload-pack option of "git clone" to transport.Steve Haslam
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>
2008-07-25Merge branch 'maint'Junio C Hamano
* 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
2008-07-25Makefile: fix shell quotingJunio C Hamano
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>
2008-07-25tests: propagate $(TAR) down from the toplevel MakefileJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-25Merge branch 'ph/checkout'Junio C Hamano
* ph/checkout: git-checkout: improve error messages, detect ambiguities. git-checkout: fix command line parsing.
2008-07-25git-checkout: improve error messages, detect ambiguities.Pierre Habouzit
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>
2008-07-25update test case to protect am --skip behaviourOlivier Marin
Signed-off-by: Olivier Marin <dkr@freesurf.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-23git-filter-branch.sh: Allow running in bare repositoriesPetr Baudis
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>
2008-07-23git-am: Add colon before the subject that is printed out as being appliedStephan Beyer
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>
2008-07-23sort_in_topological_order(): avoid setting a commit flagJohannes Schindelin
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>
2008-07-23Add test to show that show-branch misses out the 8th columnJohannes Schindelin
Noticed by Pasky. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-23t/t4202-log.sh: add newline at end of fileBrandon Casey
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>
2008-07-23t7502-commit.sh: rearrange test to make more portableBrandon Casey
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>
2008-07-23t3200,t7201: replace '!' with test_must_failBrandon Casey
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-23t4116-apply-reverse.sh: use $TAR rather than tarBrandon Casey
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-23t/: Replace diff [-u|-U0] with test_cmp to allow compilation with old diffBrandon Casey
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-07-23t7601: extend the 'merge picks up the best result' testMiklos Vajna
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>
2008-07-22git am --skip: clean the index while preserving local changesOlivier Marin
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>
2008-07-22builtin-merge: give a proper error message for invalid strategies in configMiklos Vajna
'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>
2008-07-22tests: do not rely on external "patch"Junio C Hamano
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>
2008-07-22parse-options: fix segmentation fault when a required value is missingOlivier Marin
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>
2008-07-22Rename .git/rebase to .git/rebase-applyJohannes Schindelin
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>
2008-07-21Merge branch 'ns/am-abort'Junio C Hamano
* ns/am-abort: git am --abort
2008-07-21Merge branch 'jc/add-addremove'Junio C Hamano
* 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
2008-07-21"needs update" considered harmfulJunio C Hamano
"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>