summaryrefslogtreecommitdiff
path: root/t
AgeCommit message (Collapse)Author
2007-11-18Merge git://git.bogomips.org/git-svnJunio C Hamano
* git://git.bogomips.org/git-svn: git-svn: Fix a typo and add a comma in an error message in git-svn git-svn log: handle unreachable revisions like "svn log" git-svn log: include commit log for the smallest revision in a range git-svn log: fix ascending revision ranges git-svn's dcommit must use subversion's config git-svn: add tests for command-line usage of init and clone commands
2007-11-17git-svn log: handle unreachable revisions like "svn log"David D Kilzer
When unreachable revisions are given to "svn log", it displays all commit logs in the given range that exist in the current tree. (If no commit logs are found in the current tree, it simply prints a single commit log separator.) This patch makes "git-svn log" behave the same way. Ten tests added to t/t9116-git-svn-log.sh. Signed-off-by: David D Kilzer <ddkilzer@kilzer.net> Acked-by: Eric Wong <normalperson@yhbt.net>
2007-11-17git-svn log: include commit log for the smallest revision in a rangeDavid D Kilzer
The "svn log -rM:N" command shows commit logs inclusive in the range [M,N]. Previously "git-svn log" always excluded the commit log for the smallest revision in a range, whether the range was ascending or descending. With this patch, the smallest revision in a range is always shown. Updated tests for ascending and descending revision ranges. Signed-off-by: David D Kilzer <ddkilzer@kilzer.net> Acked-by: Eric Wong <normalperson@yhbt.net>
2007-11-17git-svn log: fix ascending revision rangesDavid D Kilzer
Fixed typo in Git::SVN::Log::git_svn_log_cmd(). Previously a command like "git-svn log -r1:4" would only show a commit log separator. Added tests for ascending and descending revision ranges. Signed-off-by: David D Kilzer <ddkilzer@kilzer.net> Acked-by: Eric Wong <normalperson@yhbt.net>
2007-11-17git-svn: add tests for command-line usage of init and clone commandsEric Wong
Some patches broke these commands in certain cases and were only caught by manual testing. Signed-off-by: Eric Wong <normalperson@yhbt.net>
2007-11-17Fix and improve t7004 (git-tag tests)Mike Hommey
Brown paper bag fix to avoid using non portable sed syntax. The test by itself didn't catch what it was supposed to, anyways. The new test first checks if git-tag correctly errors out when the user exited the editor without editing the file. Then it checks if what the user was presented in the editor was any useful, which we define as the following: * It begins with a single blank line, where the invoked editor would typically place the editing curser at, so that the user can immediately start typing; * It has some instruction but that comes after that initial blank line, all lines prefixed with "#". We specifically do not check for the wording of this instruction. * And it has nothing else, as the expected behaviour is "Hey you did not leave any message". Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-17Merge branch 'maint'Junio C Hamano
* maint: Update draft release notes for 1.5.3.6 Fix per-directory exclude handing for "git add" core.excludesfile clean-up Fix t9101 test failure caused by Subversion "auto-props" git-send-email: add charset header if we add encoded 'From'
2007-11-17Fix per-directory exclude handing for "git add"Junio C Hamano
In "dir_struct", each exclusion element in the exclusion stack records a base string (pointer to the beginning with length) so that we can tell where it came from, but this pointer is just pointing at the parameter that is given by the caller to the push_exclude_per_directory() function. While read_directory_recursive() runs, calls to excluded() makes use the data in the exclusion elements, including this base string. The caller of read_directory_recursive() is not supposed to free the buffer it gave to push_exclude_per_directory() earlier, until it returns. The test case Bruce Stephens gave in the mailing list discussion was simplified and added to the t3700 test. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-17Fix t9101 test failure caused by Subversion "auto-props"Wincent Colaiuta
If a user has an "auto-prop" in his/her ~/.subversion/config file for automatically setting the svn:keyword Id property on all ".c" files (a reasonably common configuration in the Subversion world) then one of the "svn propset" operations in the very first test would become a no-op, which in turn would make the next commit a no-op. This then caused the 25th test ('test propget') to fail because it expects a certain number of commits to have taken place but the actual number of commits was off by one. Björn Steinbrink identified the "auto-prop" feature as the cause of the failure. This patch avoids it by passing the "--no-auto-prop" flag to "svn import" when setting up the test repository, thus ensuring that the "svn propset" operation is no longer a no-op, regardless of the users' settings in their config. Signed-off-by: Wincent Colaiuta <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-16Fix per-directory exclude handing for "git add"Junio C Hamano
In "dir_struct", each exclusion element in the exclusion stack records a base string (pointer to the beginning with length) so that we can tell where it came from, but this pointer is just pointing at the parameter that is given by the caller to the push_exclude_per_directory() function. While read_directory_recursive() runs, calls to excluded() makes use the data in the exclusion elements, including this base string. The caller of read_directory_recursive() is not supposed to free the buffer it gave to push_exclude_per_directory() earlier, until it returns. The test case Bruce Stephens gave in the mailing list discussion was simplified and added to the t3700 test. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-14Merge branch 'sp/fetch-fix'Junio C Hamano
* sp/fetch-fix: git-fetch: avoid local fetching from alternate (again) rev-list: Introduce --quiet to avoid /dev/null redirects run-command: Support sending stderr to /dev/null git-fetch: Always fetch tags if the object they reference exists
2007-11-14Merge branch 'bs/maint-commit-options'Junio C Hamano
* bs/maint-commit-options: git-commit: Add tests for invalid usage of -a/--interactive with paths git-commit.sh: Fix usage checks regarding paths given when they do not make sense
2007-11-14Merge branch 'rv/maint-index-commit'Junio C Hamano
* rv/maint-index-commit: Make GIT_INDEX_FILE apply to git-commit
2007-11-14Merge branch 'bs/maint-t7005'Junio C Hamano
* bs/maint-t7005: t7005-editor.sh: Don't invoke real vi when it is in GIT_EXEC_PATH
2007-11-14Merge branch 'jc/maint-add-sync-stat'Junio C Hamano
* jc/maint-add-sync-stat: t2200: test more cases of "add -u" git-add: make the entry stat-clean after re-adding the same contents ce_match_stat, run_diff_files: use symbolic constants for readability Conflicts: builtin-add.c
2007-11-14Merge branch 'mh/retag'Junio C Hamano
* mh/retag: Add tests for git tag Reuse previous annotation when overwriting a tag
2007-11-14Merge branch 'bg/format-patch-N'Junio C Hamano
* bg/format-patch-N: Rearrange git-format-patch synopsis to improve clarity. format-patch: Test --[no-]numbered and format.numbered format-patch: Add configuration and off switch for --numbered
2007-11-14Merge branch 'js/rebase-detached'Junio C Hamano
* js/rebase-detached: rebase: fix "rebase --continue" breakage rebase: operate on a detached HEAD
2007-11-14Merge branch 'maint'Junio C Hamano
* maint: git-clean: honor core.excludesfile Documentation: Fix man page breakage with DocBook XSL v1.72 git-remote.txt: fix typo core-tutorial.txt: Fix argument mistake in an example. replace reference to git-rm with git-reset in git-commit doc Grammar fixes for gitattributes documentation Don't allow fast-import tree delta chains to exceed maximum depth revert/cherry-pick: allow starting from dirty work tree. t/t3404: fix test for a bogus todo file. Conflicts: fast-import.c
2007-11-14git-clean: honor core.excludesfileJunio C Hamano
git-clean did not honor core.excludesfile configuration variable, although some other commands such as git-add and git-status did. Fix this inconsistency. Original report and patch from Shun'ichi Fuji. Rewritten by me and bugs and tests are mine. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-13t/t3404: fix test for a bogus todo file.Junio C Hamano
The test wants to see if there are still remaining tasks, but checked a wrong file. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-13git-commit: Add tests for invalid usage of -a/--interactive with pathsBjörn Steinbrink
git-commit was/is broken in that it accepts paths together with -a or --interactive, which it shouldn't. There tests check those usage errors. Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-13rebase: fix "rebase --continue" breakageJohannes Schindelin
The --skip case was handled properly when rebasing without --merge, but the --continue case was not. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-12git-svn: support for funky branch and project names over HTTP(S)Eric Wong
SVN requires that paths be URI-escaped for HTTP(S) repositories. file:// and svn:// repositories do not need these rules. Additionally, accessing individual paths inside repositories (check_path() and get_log() do NOT require escapes to function and in fact it breaks things). Noticed-by: Michael J. Cohen <mjc@cruiseplanners.com> Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-12Merge branch 'maint'Junio C Hamano
* maint: for-each-ref: fix off by one read. git-branch: remove mention of non-existent '-b' option git-svn: prevent dcommitting if the index is dirty. Fix memory leak in traverse_commit_list
2007-11-12git-svn: prevent dcommitting if the index is dirty.Benoit Sigoure
dcommit uses rebase to sync the history with what has just been pushed to SVN. Trying to dcommit with a dirty index is troublesome for rebase, so now the user will get an error message if he attempts to dcommit with a dirty index. Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-12t2200: test more cases of "add -u"Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-12git-fetch: avoid local fetching from alternate (again)Shawn O. Pearce
Back in e3c6f240fd9c5bdeb33f2d47adc859f37935e2df Junio taught git-fetch to avoid copying objects when we are fetching from a repository that is already registered as an alternate object database. In such a case there is no reason to copy any objects as we can already obtain them through the alternate. However we need to ensure the objects are all reachable, so we run `git rev-list --objects $theirs --not --all` to verify this. If any object is missing or unreadable then we need to fetch/copy the objects from the remote. When a missing object is detected the git-rev-list process will exit with a non-zero exit status, making this condition quite easy to detect. Although git-fetch is currently a builtin (and so is rev-list) we cannot invoke the traverse_objects() API at this point in the transport code. The object walker within traverse_objects() calls die() as soon as it finds an object it cannot read. If that happens we want to resume the fetch process by calling do_fetch_pack(). To get around this we spawn git-rev-list into a background process to prevent a die() from killing the foreground fetch process, thus allowing the fetch process to resume into do_fetch_pack() if copying is necessary. We aren't interested in the output of rev-list (a list of SHA-1 object names that are reachable) or its errors (a "spurious" error about an object not being found as we need to copy it) so we redirect both stdout and stderr to /dev/null. We run this git-rev-list based check before any fetch as we may already have the necessary objects local from a prior fetch. If we don't then its very likely the first $theirs object listed on the command line won't exist locally and git-rev-list will die very quickly, allowing us to start the network transfer. This test even on remote URLs may save bandwidth if someone runs `git pull origin`, sees a merge conflict, resets out, then redoes the same pull just a short time later. If the remote hasn't changed between the two pulls and the local repository hasn't had git-gc run in it then there is probably no need to perform network transfer as all of the objects are local. Documentation for the new quickfetch function was suggested and written by Junio, based on his original comment in git-fetch.sh. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-11-11t7005-editor.sh: Don't invoke real vi when it is in GIT_EXEC_PATHBjörn Steinbrink
The git wrapper executable always prepends the GIT_EXEC_PATH build variable to the current PATH, so prepending "." to the PATH is not enough to give precedence to the fake vi executable. The --exec-path option allows to prepend a directory to PATH even before GIT_EXEC_PATH (which is added anyway), so we can use that instead. Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-11Make GIT_INDEX_FILE apply to git-commitRémi Vanicat
Currently, when committing, git-commit ignore the value of GIT_INDEX_FILE, and always use $GIT_DIR/index. This patch fix it. Signed-off-by: Rémi Vanicat <vanicat@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-11Merge branch 'js/upload-pack'Junio C Hamano
* js/upload-pack: upload-pack: Use finish_{command,async}() instead of waitpid().
2007-11-11Merge branch 'js/reset'Junio C Hamano
* js/reset: builtin-reset: avoid forking "update-index --refresh" builtin-reset: do not call "ls-files --unmerged"
2007-11-11Merge branch 'js/parseopt-abbrev-fix'Junio C Hamano
* js/parseopt-abbrev-fix: parse-options: abbreviation engine fix.
2007-11-10test-lib.sh: move error line after error() declarationMichele Ballabio
This patch removes a spurious "command not found" error and actually makes the "Test script did not set test_description." string follow the command line option "--no-color". Signed-off-by: Michele Ballabio <barra_cuda@katamail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-10for-each-ref: fix setup of option-parsing for --sortLars Hjemli
The option value for --sort is already a pointer to a pointer to struct ref_sort, so just use it. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-10git-commit: a bit more testsJunio C Hamano
Add tests for -s (sign-off) and multiple -m options Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-09rebase: operate on a detached HEADJohannes Schindelin
The interactive version of rebase does all the operations on a detached HEAD, so that after a successful rebase, <branch>@{1} is the pre-rebase state. The reflogs of "HEAD" still show all the actions in detail. This teaches the non-interactive version to do the same. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-09Merge branch 'maint'Junio C Hamano
* maint: Start preparing for 1.5.3.6 git-send-email: Change the prompt for the subject of the initial message. SubmittingPatches: improve the 'Patch:' section of the checklist instaweb: Minor cleanups and fixes for potential problems stop t1400 hiding errors in tests Makefile: add missing dependency on wt-status.h refresh_index_quietly(): express "optional" nature of index writing better Fix sed string regex escaping in module_name. Avoid a few unportable, needlessly nested "...`...". git-mailsplit: with maildirs not only process cur/, but also new/ Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-09stop t1400 hiding errors in testsAlex Riesen
The last rm in the test was lacking an "&&" before it, which caused the errors in the commands be silently hidden. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-08Merge branch 'jc/clean-config'Junio C Hamano
* jc/clean-config: clean: require -f to do damage by default
2007-11-06Add tests for git tagMike Hommey
These tests check whether git-tag properly sends a comment into the editor, and whether it reuses previous annotation when overwriting an existing tag. Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-06upload-pack: Use finish_{command,async}() instead of waitpid().Johannes Sixt
upload-pack spawns two processes, rev-list and pack-objects, and carefully monitors their status so that it can report failure to the remote end. This change removes the complicated procedures on the grounds of the following observations: - If everything is OK, rev-list closes its output pipe end, upon which pack-objects (which reads from the pipe) sees EOF and terminates itself, closing its output (and error) pipes. upload-pack reads from both until it sees EOF in both. It collects the exit codes of the child processes (which indicate success) and terminates successfully. - If rev-list sees an error, it closes its output and terminates with failure. pack-objects sees EOF in its input and terminates successfully. Again upload-pack reads its inputs until EOF. When it now collects the exit codes of its child processes, it notices the failure of rev-list and signals failure to the remote end. - If pack-objects sees an error, it terminates with failure. Since this breaks the pipe to rev-list, rev-list is killed with SIGPIPE. upload-pack reads its input until EOF, then collects the exit codes of the child processes, notices their failures, and signals failure to the remote end. - If upload-pack itself dies unexpectedly, pack-objects is killed with SIGPIPE, and subsequently also rev-list. The upshot of this is that precise monitoring of child processes is not required because both terminate if either one of them dies unexpectedly. This allows us to use finish_command() and finish_async() instead of an explicit waitpid(2) call. The change is smaller than it looks because most of it only reduces the indentation of a large part of the inner loop. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-06builtin-reset: avoid forking "update-index --refresh"Johannes Schindelin
Instead of forking update-index, call refresh_cache() directly. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-06builtin-reset: do not call "ls-files --unmerged"Johannes Schindelin
Since reset is a builtin now, it can use the full power of libgit.a and check for unmerged entries itself. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-06parse-options: abbreviation engine fix.Johannes Schindelin
When an option could be an ambiguous abbreviation of two options, the code used to error out. Even if an exact match would have occured later. Test and original patch by Pierre Habouzit. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-06Merge branch 'maint'Junio C Hamano
* maint: Remove a couple of duplicated include grep with unmerged index git-daemon: fix remote port number in log entry git-svn: t9114: verify merge commit message in test git-svn: fix dcommit clobbering when committing a series of diffs
2007-11-05t3502: Disambiguate between file and rev by adding --Brian Gernhardt
On a case insensitive file system, this test fails because git-diff doesn't know if it is asking for the file "A" or the tag "a". Adding "--" at the end of the ambiguous commands allows the test to finish properly. Signed-off-by: Brian Gernhardt <benji@silverinsanity.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-05Add more tests for git-cleanShawn Bohrer
Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-05git-svn: t9114: verify merge commit message in testEric Wong
It's possible that we end up with an incorrect commit message in this test after making changes to fix the clobber bug in dcommit. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-05git-svn: fix dcommit clobbering when committing a series of diffsEric Wong
Our revision number sent to SVN is set to the last revision we committed if we've made any previous commits in a dcommit invocation. Although our SVN Editor code uses the delta of two (old) trees to generate information to send upstream, it'll still send complete resultant files upstream; even if the tree they're based against is out-of-date. The combination of sending a file that does not include the latest changes, but set with a revision number of a commit we just made will cause SVN to accept the resultant file even if it was generated against an old tree. More trouble was caused when fixing this because we were rebasing uncessarily at times. We used git-diff-tree to check the imported SVN revision against our HEAD, not the last tree we committed to SVN. The unnecessary rebasing caused merge commits upstream to SVN to fail. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>