aboutsummaryrefslogtreecommitdiff
path: root/t
Commit message (Collapse)AuthorAge
* git svn: reset invalidates the memoized mergeinfo cachesPeter Baumann2012-08-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since v1.7.0-rc2~11 (git-svn: persistent memoization, 2010-01-30), git-svn has maintained some private per-repository caches in .git/svn/.caches to avoid refetching and recalculating some mergeinfo-related information with every 'git svn fetch'. This memoization can cause problems, e.g consider the following case: SVN repo: ... - a - b - c - m <- trunk \ / d - e <- branch1 The Git import of the above repo is at commit 'a' and doesn't know about the branch1. In case of an 'git svn rebase', only the trunk of the SVN repo is imported. During the creation of the git commit 'm', git svn uses the svn:mergeinfo property and tries to find the corresponding git commit 'e' to create 'm' with 'c' and 'e' as parents. But git svn rebase only imports the current branch so commit 'e' is not imported. Therefore git svn fails to create commit 'm' as a merge commit, because one of its parents is not known to git. The imported history looks like this: ... - a - b - c - m <- trunk A later 'git svn fetch' to import all branches can't rewrite the commit 'm' to add 'e' as a parent and to make it a real git merge commit, because it was already imported. That's why the imported history misses the merge and looks like this: ... - a - b - c - m <- trunk \ d - e <- branch1 Right now the only known workaround for importing 'm' as a merge is to force reimporting 'm' again from SVN, e.g. via $ git svn reset --revision $(git find-rev $c) $ git svn fetch Sadly, this is where the behavior has regressed: git svn reset doesn't invalidate the old mergeinfo cache, which is no longer valid for the reimport, which leads to 'm' beeing imprted with only 'c' as parent. As solution to this problem, this commit invalidates the mergeinfo cache to force correct recalculation of the parents. During development of this patch, several ways for invalidating the cache where considered. One of them is to use Memoize::flush_cache, which will call the CLEAR method on the underlying Memoize persistency implementation. Sadly, neither Memoize::Storable nor the newer Memoize::YAML module introduced in 68f532f4ba888 could optionally be used implement the CLEAR method, so this is not an option. Reseting the internal hash used to store the memoized values has the same problem, because it calls the non-existing CLEAR method of the underlying persistency layer, too. Considering this and taking into account the different implementations of the memoization modules, where Memoize::Storable is not in our control, implementing the missing CLEAR method is not an option, at least not if Memoize::Storable is still used. Therefore the easiest solution to clear the cache is to delete the files on disk in 'git svn reset'. Normally, deleting the files behind the back of the memoization module would be problematic, because the in-memory representation would still exist and contain wrong data. Fortunately, the memoization is active in memory only for a small portion of the code. Invalidating the cache by deleting the files on disk if it isn't active should be safe. Signed-off-by: Peter Baumann <waste.manager@gmx.de> Signed-off-by: Steven Walter <stevenrwalter@gmail.com> Signed-off-by: Eric Wong <normalperson@yhbt.net>
* git svn: handle errors and concurrent commits in dcommitRobert Luberda2012-08-10
| | | | | | | | | | | | | | | | | | | | | dcommit didn't handle errors returned by SVN and coped very poorly with concurrent commits that appear in SVN repository while dcommit was running. In both cases it left git repository in inconsistent state: index (which was reset with `git reset --mixed' after a successful commit to SVN) no longer matched the checkouted tree, when the following commit failed or needed to be rebased. See http://bugs.debian.org/676904 for examples. This patch fixes the issues by: - introducing error handler for dcommit. The handler will try to rebase or reset working tree before returning error to the end user. dcommit_rebase function was extracted out of cmd_dcommit to ensure consistency between cmd_dcommit and the error handler. - calling `git reset --mixed' only once after all patches are successfully committed to SVN. This ensures index is not touched for most of the time of dcommit run. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* Merge branch 'jx/i18n-1.7.11'Junio C Hamano2012-07-31
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Add i18n support for scripted Porcelains, and mark strings in merge(-recursive), am, and rebase for i18n. * jx/i18n-1.7.11: i18n: merge-recursive: mark strings for translation Remove dead code which contains bad gettext block i18n: am: mark more strings for translation rebase: remove obsolete and unused LONG_USAGE which breaks xgettext i18n: Rewrite gettext messages start with dash i18n: rebase: mark messages for translation i18n: New keywords for xgettext extraction from sh
| * i18n: merge-recursive: mark strings for translationJiang Xin2012-07-26
| | | | | | | | | | | | | | | | | | | | | | | | | | Mark strings in merge-recursive for translation. Some tests would start to fail with GETTEXT_POISON turned on after this update. Use test_i18ncmp and test_i18ngrep where appropriate to mark strings that should only be checked in the C locale output to avoid such issues. Signed-off-by: Jiang Xin <worldhello.net@gmail.com> Reviewed-by: Stefano Lattarini <stefano.lattarini@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * i18n: Rewrite gettext messages start with dashJiang Xin2012-07-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Gettext message in a shell script should not start with '-', one workaround is adding '--' between gettext and the message, like: gettext -- "--exec option ..." But due to a bug in the xgettext extraction, xgettext can not extract the actual message for this case. Rewriting the message is a simpler and better solution. Reported-by: Vincent van Ravesteijn <vfr@lyx.org> Signed-off-by: Jiang Xin <worldhello.net@gmail.com> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Reviewed-by: Stefano Lattarini <stefano.lattarini@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * i18n: rebase: mark messages for translationJiang Xin2012-07-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mark messages in git-rebase.sh for translation. While doing this Jonathan noticed that the comma usage and sentence structure of the resolvemsg was not quite right, so correct that and its cousins in git-am.sh and t/t0201-gettext-fallbacks.sh at the same time. Some tests would start to fail with GETTEXT_POISON turned on after this update. Use test_i18ncmp and test_i18ngrep where appropriate to mark strings that should only be checked in the C locale output to avoid such issues. Signed-off-by: Jiang Xin <worldhello.net@gmail.com> Reviewed-by: Stefano Lattarini <stefano.lattarini@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'rj/maint-grep-remove-redundant-test'Junio C Hamano2012-07-30
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | "git grep" stopped spawning an external "grep" long time ago, but a duplicated test to check internal and external "grep" was left behind. * rj/maint-grep-remove-redundant-test: t7810-*.sh: Remove redundant test
| * | t7810-*.sh: Remove redundant testRamsay Jones2012-07-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit bbc09c22 ("grep: rip out support for external grep", 12-01-2010), test number 60 ("grep -C1 hunk mark between files") is essentially the same as test number 59. Test 59 was intended to verify the behaviour of git-grep resulting from multiple invocations of an external grep. As part of the test, it creates and adds 1024 files to the index, which is now wasted effort. Remove test 59, since it is now redundant. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'dg/submodule-in-dismembered-working-tree'Junio C Hamano2012-07-30
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Finishing touches to the new test script. * dg/submodule-in-dismembered-working-tree: t7409: make sure submodule is initialized and updated in more detail
| * | | t7409: make sure submodule is initialized and updated in more detailDaniel Graña2012-07-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The earlier test did not even make sure that the correct commit is checked out in the submodule directory. Inspect the result in a bit more detail. Signed-off-by: Daniel Graña <dangra@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | t1100-*.sh: Fix an intermittent test failureRamsay Jones2012-07-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In particular, the final test ('flags and then non flags') fails intermittently, depending on how much time elapsed between the invocations of "git commit-tree" when creating the commits which later have their commit id's compared. For example, if the commits for childid-3 and childid-4 are created 1 or more seconds apart, then the commits, which would otherwise be identical, will have different commit id's. In order to make the test reproducible, we remove the variability by setting the author and committer times to a well defined state. We accomplish this with a single call to 'test_tick' at the start of the test. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | t: add missing executable bit to t7409Jeff King2012-07-29
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'extract-remaining' of git://git.bogomips.org/git-svnJunio C Hamano2012-07-27
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'extract-remaining' of git://git.bogomips.org/git-svn: Extract Git::SVN::GlobSpec from git-svn. Move Git::IndexInfo into its own file. Load all the modules in one place and before running code. Extract Git::SVN::Migration from git-svn. Prepare Git::SVN::Migration for extraction from git-svn. Extract Git::SVN::Log from git-svn. Prepare Git::SVN::Log for extraction from git-svn.
| * | | | Extract Git::SVN::GlobSpec from git-svn.Michael G. Schwern2012-07-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Straight cut & paste. That's the last class. * Make Git::SVN load it on its own, its the only thing that needs it. Signed-off-by: Eric Wong <normalperson@yhbt.net>
| * | | | Move Git::IndexInfo into its own file.Michael G. Schwern2012-07-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Straight cut & paste. Didn't require any fixing. Signed-off-by: Eric Wong <normalperson@yhbt.net>
| * | | | Extract Git::SVN::Migration from git-svn.Michael G. Schwern2012-07-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Straight cut & paste. Signed-off-by: Eric Wong <normalperson@yhbt.net>
| * | | | Extract Git::SVN::Log from git-svn.Michael G. Schwern2012-07-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Straight cut & paste. Also noticed Git::SVN::Ra wasn't in the compile test. It is now. Signed-off-by: Eric Wong <normalperson@yhbt.net>
* | | | | Merge git://git.bogomips.org/git-svnJunio C Hamano2012-07-27
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.bogomips.org/git-svn: Move initialization of Git::SVN variables into Git::SVN. Extract Git::SVN from git-svn into its own .pm file. Prepare Git::SVN for extraction into its own file. Extract some utilities from git-svn to allow extracting Git::SVN. perl: detect new files in MakeMaker builds The Makefile.PL will now find .pm files itself. Don't lose Error.pm if $@ gets clobbered. Quiet warning if Makefile.PL is run with -w and no --localedir
| * | | | Move initialization of Git::SVN variables into Git::SVN.Michael G. Schwern2012-07-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also it can compile on its own now, yay! Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Eric Wong <normalperson@yhbt.net>
| * | | | Extract some utilities from git-svn to allow extracting Git::SVN.Michael G. Schwern2012-07-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Put them in a new module called Git::SVN::Utils. Yeah, not terribly original and it will be a dumping ground. But its better than having them in the main git-svn program. At least they can be documented and tested. * fatal() is used by many classes. * Change the $can_compress lexical into a function. This should be enough to extract Git::SVN. Signed-off-by: Michael G. Schwern <schwern@pobox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Eric Wong <normalperson@yhbt.net>
* | | | | Merge branch 'jk/autoident-test'Junio C Hamano2012-07-27
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix test breakages by a builder who does not have a valid user name in his /etc/password entry. * jk/autoident-test: t7502: test early quit from commit with bad ident t7502: handle systems where auto-identity is broken t7502: drop confusing test_might_fail call t7502: narrow checks for author/committer name in template t7502: properly quote GIT_EDITOR t7502: clean up fake_editor tests
| * | | | | t7502: test early quit from commit with bad identJeff King2012-07-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit f20f387, "git commit" notices and dies much earlier when we have a bogus commit identity. That commit did not add a test because we cannot do so reliably (namely, we can only trigger the behavior on a system where the automatically generated identity is bogus). However, now that we have a prerequisite check for this feature, we can add a test that will at least run on systems that produce such a bogus identity. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | t7502: handle systems where auto-identity is brokenJeff King2012-07-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test t7502.21 checks whether we write the committer name into COMMIT_EDITMSG when it has been automatically determined. However, not all systems can produce valid automatic identities. Prior to f20f387 (commit: check committer identity more strictly), this test worked even when we did not have a valid automatic identity, since it did not run the strict test until after we had generated the template. That commit tightened the check to fail early (since we would fail later, anyway), meaning that systems without a valid GECOS name or hostname would fail the test. We cannot just work around this, because it depends on configuration outside the control of the test script. Therefore we introduce a new test_prerequisite to run this test only on systems where automatic ident works at all. As a result, we can drop the confusing test_must_fail bit from the test. The intent was that by giving "git commit" invalid input (namely, nothing to commit), that it would stop at a predictable point, whether we had a valid identity or not, from which we could view the contents of COMMIT_EDITMSG. Since that assumption no longer holds, and we can only run the test when we have a valid identity, there is no reason not to let commit run to completion. That lets us be more robust to other unforeseen failures. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | t7502: drop confusing test_might_fail callJeff King2012-07-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In t7502.20, we run "git commit" and check that it warns us that the author and committer identity are not the same (this is always the case in the test environment, since we set up the idents differently). Instead of actually making a commit, we have a clean index, so the "git commit" we run will fail. This is marked as might_fail, which is not really correct; it will always fail since there is nothing to commit. However, the only reason not to do a complete commit would be to see the intermediate state of the COMMIT_EDITMSG file when the commit is not completed. We don't need to care about this, though; even a complete commit will leave COMMIT_EDITMSG for us to view. By doing a real commit and dropping the might_fail, we are more robust against other unforeseen failures of "git commit" that might influence our test result. It might seem less robust to depend on the fact that "git commit" leaves COMMIT_EDITMSG in place after a successful commit. However, that brings this test in line with others parts of the script, which make the same assumption. Furthermore, if that ever does change, the right solution is not to prevent commit from completing, but to set EDITOR to a script that will record the contents we see. After all, the point of these tests is to check what the user sees in their EDITOR, so that would be the most direct test. For now, though, we can continue to use the "shortcut" that COMMIT_EDITMSG is left intact. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | t7502: narrow checks for author/committer name in templateJeff King2012-07-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | t7502.20 and t7502.21 check that the author and committer name are mentioned in the commit message template under certain circumstances. However, they end up checking a much larger and unnecessary portion of the template. Let's narrow their checks to the specific lines. While we're at it, let's give these tests more descriptive names, so their purposes are more obvious. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | t7502: properly quote GIT_EDITORJeff King2012-07-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One of the tests tries to ensure that editor is not run due to an early failure. However, it needs to quote the pathname of the trash directory used in $GIT_EDITOR, since git will pass it along to the shell. In other words, the test would pass whether the code was correct or not, since the unquoted editor specification would never run. We never noticed the problem because the code is indeed correct, so git-commit never even tried to run the editor. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | t7502: clean up fake_editor testsJeff King2012-07-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using write_script saves us a few lines of code, and means we consistently use $SHELL_PATH. We can also drop the setting of the $pwd variable from $(pwd). In the first instance, there is no reason to use it (we can just use $(pwd) directly two lines later, since we are interpolating the here-document). In the second instance, it is totally pointless and probably just a cut-and-paste from the first instance. Finally, we can use a non-interpolating here document for the final script, which saves some quoting. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Merge branch 'dg/submodule-in-dismembered-working-tree'Junio C Hamano2012-07-27
|\ \ \ \ \ \ | |_|/ / / / |/| | / / / | | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | In a superproject that has repository outside of its working tree, "git submodule add" failed to clone a new submodule, as GIT_DIR and GIT_WORK_TREE environment variables necessary to work in such a superproject interfered with access to the submodule repository. * dg/submodule-in-dismembered-working-tree: git-submodule: work with GIT_DIR/GIT_WORK_TREE
| * | | | git-submodule: work with GIT_DIR/GIT_WORK_TREEDaniel Graña2012-07-25
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The combination of GIT_DIR and GIT_WORK_TREE can be used to manage files in one directory hierarchy while keeping the repository that keeps track of them outside the directory hierarchy. For example: git init --bare /path/to/there alias dotfiles="GIT_DIR=/path/to/there GIT_WORK_TREE=/path/to/here git" cd /path/to/here dotfiles add file dotfiles commit -a -m "add /path/to/here/file" ... lets you manage files under /path/to/here/ in the repository located at /path/to/there. git-submodule however fails to add submodules, as it is confused by GIT_DIR and GIT_WORK_TREE environment variables when it tries to work in the submodule, like so: dotfiles submodule add http://path.to/submodule fatal: working tree '/path/to/here' already exists. Simply unsetting the environment where the command works on the submodule is sufficient to fix this, as it has set things up so that GIT_DIR and GIT_WORK_TREE do not even have to point at the repository and the working tree of the submodule. Signed-off-by: Daniel Graña <dangra@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'jc/test-lib-source-build-options-early'Junio C Hamano2012-07-25
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reorders t/test-lib.sh so that we dot-source GIT-BUILD-OPTIONS that records the shell and Perl the user told us to use with Git a lot early, so that test-lib.sh script itself can use "$PERL_PATH" in one of its early operations. * jc/test-lib-source-build-options-early: test-lib: reorder and include GIT-BUILD-OPTIONS a lot earlier
| * | | | test-lib: reorder and include GIT-BUILD-OPTIONS a lot earlierJunio C Hamano2012-06-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This dot-sources GIT-BUILD-OPTIONS a lot earlier in test-lib.sh so that its use of "perl" can use "$PERL_PATH" to choose the version of Perl the user told us is suitable for our use. This is iffy; I didn't check it very carefully, and I would not be surprised if there are subtle breakages. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'mm/config-xdg'Junio C Hamano2012-07-25
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Finishing touches to the XDG support (new feature for 1.7.12) and tests. * mm/config-xdg: t1306: check that XDG_CONFIG_HOME works ignore: make sure we have an xdg path before using it attr: make sure we have an xdg path before using it test-lib.sh: unset XDG_CONFIG_HOME
| * | | | | t1306: check that XDG_CONFIG_HOME worksJeff King2012-07-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This should override $HOME/.config, but we never actually tested it. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | ignore: make sure we have an xdg path before using itMatthieu Moy2012-07-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit e3ebc35 (config: fix several access(NULL) calls, 2012-07-12) was fixing access(NULL) calls when trying to access $HOME/.config/git/config, but missed the ones when trying to access $HOME/.config/git/ignore. Fix and test this. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | attr: make sure we have an xdg path before using itJeff King2012-07-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we don't have a core.attributesfile configured, we fall back to checking XDG config, which is usually $HOME/.config/git/attributes. However, if $HOME is unset, then home_config_paths will return NULL, and we end up calling fopen(NULL). Depending on your system, this may or may not cause the accompanying test to fail (e.g., on Linux and glibc, the address will go straight to open, which will return EFAULT). However, valgrind will reliably notice the error. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | test-lib.sh: unset XDG_CONFIG_HOMEJeff King2012-07-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that git respects XDG_CONFIG_HOME for some lookups, we must be sure to cleanse the test environment. Otherwise, the user's XDG_CONFIG_HOME could influence the test results. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Merge branch 'cw/rebase-i-root'Junio C Hamano2012-07-25
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Finishing touches to the "rebase -i --root" (new feature for 1.7.12). * cw/rebase-i-root: rebase -i: handle fixup of root commit correctly
| * | | | | rebase -i: handle fixup of root commit correctlyChris Webb2012-07-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a bug with git rebase -i --root when a fixup or squash line is applied to the new root. We attempt to amend the commit onto which they apply with git reset --soft HEAD^ followed by a normal commit. Unlike a real commit --amend, this sequence will fail against a root commit as it has no parent. Fix rebase -i to use commit --amend for fixup and squash instead, and add a test for the case of a fixup of the root commit. Signed-off-by: Chris Webb <chris@arachsys.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | t/lib-httpd: handle running under --valgrindJeff King2012-07-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running the http tests with valgrind does not work for two reasons: 1. Apache complains about following the symbolic link from git-http-backend to valgrind.sh. 2. Apache does not pass through the GIT_VALGRIND variable to the backend CGI. This patch fixes both problems. Unfortunately, there is a slight hack we need to handle passing environment variables through Apache. If we just tell it: PassEnv GIT_VALGRIND then Apache will complain when GIT_VALGRIND is not set. If we try: SetEnv GIT_VALGRIND ${GIT_VALGRIND} then when GIT_VALGRIND is not set, it will pass through the literal "${GIT_VALGRIND}". Instead, we now unconditionally pass through GIT_VALGRIND from lib-httpd.sh into apache, even if it is empty. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Merge branch 'jv/maint-no-ext-diff'Junio C Hamano2012-07-23
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git diff --no-ext-diff" did not output anything for a typechange filepair when GIT_EXTERNAL_DIFF is in effect. * jv/maint-no-ext-diff: diff: test precedence of external diff drivers diff: correctly disable external_diff with --no-ext-diff
| * | | | | | diff: test precedence of external diff driversJeff King2012-07-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are three ways to specify an external diff command: GIT_EXTERNAL_DIFF in the environment, diff.external in the config, or a "diff" gitattribute. The current order of precedence is: 1. gitattribute 2. GIT_EXTERNAL_DIFF 3. diff.external Usually our rule is that environment variables should take precedence over on-disk config (i.e., option 2 should come before option 1). However, this situation is trickier than some, because option 1 is more specific to the individual file than option 2 (which affects all files), so it might be preferable. So the current behavior can be seen as implementing "do the specific thing if we can, but fall back to this general thing". This is probably not what we would do if we were writing git from scratch, but it has been this way for several years, and is not worth changing. So let's at least document that this is the way it's supposed to work with a test. While we're there, let's also make sure that diff.external (which was not previously tested at all) works by running it through the same tests as GIT_EXTERNAL_DIFF. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | diff: correctly disable external_diff with --no-ext-diffJunio C Hamano2012-07-17
| | |_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upon seeing a type-change filepair, "diff --no-ext-diff" does not show the usual "deletion followed by addition" split patch and does not run the external diff driver either. This is because the logic to disable external diff was placed at a wrong level in the callchain. run_diff_cmd() decides to show the split patch only when external diff driver is not configured or specified via GIT_EXTERNAL_DIFF environment, but this is done before checking if --no-ext-diff was given. To make things worse, run_diff_cmd() checks --no-ext-diff and disables the output for such a filepair completely, as the callchain below it (e.g. builtin_diff) does not want to handle typechange filepairs. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Merge branch 'kk/maint-commit-tree'Junio C Hamano2012-07-23
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * kk/maint-commit-tree: Revert "git-commit-tree(1): update synopsis" commit-tree: resurrect command line parsing updates
| * \ \ \ \ \ Merge branch 'kk/maint-1.7.9-commit-tree' into kk/maint-commit-treeJunio C Hamano2012-07-17
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * kk/maint-1.7.9-commit-tree: commit-tree: resurrect command line parsing updates
| | * | | | | | commit-tree: resurrect command line parsing updatesJunio C Hamano2012-07-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 79a9312 (commit-tree: update the command line parsing, 2011-11-09) updated the command line parser to understand the usual "flags first and then non-flag arguments" order, in addition to the original and a bit unusual "tree comes first and then zero or more -p <parent>". Unfortunately, ba3c69a (commit: teach --gpg-sign option, 2011-10-05) broke it by mistake. Resurrect it, and protect the feature with a test from future breakages. Noticed by Keshav Kini Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | Merge branch 'as/t4012-style-updates'Junio C Hamano2012-07-22
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * as/t4012-style-updates: t4012: Use test_must_fail instead of if-else t4012: use 'printf' instead of 'dd' to generate a binary file t4012: Re-indent test snippets t4012: Make --shortstat test more robust t4012: Break up pipe into serial redirections t4012: Actually quote the sed script t4012: Unquote git command fragment in test title t4012: modernize style for quoting
| * | | | | | | | t4012: Use test_must_fail instead of if-elseAlexander Strasser2012-07-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the code less bulky and easier to read. Also do not overlook failures like e.g. git failing because of unexpected signals. Signed-off-by: Alexander Strasser <eclipse7@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | t4012: use 'printf' instead of 'dd' to generate a binary fileJohannes Sixt2012-07-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For some reason, 'echo X | dd bs=1k seek=1' creates a file with 2050 bytes on Windows instead of the expected 1026 bytes, so that a test fails. Since the actual contents of the file are irrelevant as long as there is at least one zero byte so that the diff machinery recognizes it as binary, use printf to generate it. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Alexander Strasser <eclipse7@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | t4012: Re-indent test snippetsAlexander Strasser2012-07-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most one-level indents were 1 HT (horizontal tab) followed by 1 SP. Remove the SP. Signed-off-by: Alexander Strasser <eclipse7@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | | t4012: Make --shortstat test more robustAlexander Strasser2012-07-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The --shortstat test depends on the same scenario as the --stat test. Use the part of the same expected result for the --stat test to avoid duplicating it manually. Signed-off-by: Alexander Strasser <eclipse7@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>