summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-12-27submodule.h: add extern keyword to functionsLibravatar Stefan Beller1-25/+30
As the upcoming series will add a lot of functions to the submodule header, let's first make the header consistent to the rest of the project by adding the extern keyword to functions. As per the CodingGuidelines we try to stay below 80 characters per line, so adapt all those functions to stay below 80 characters that are already using more than one line. Those function using just one line are better kept in one line than breaking them up into multiple lines just for the goal of staying below the character limit as it makes grepping for functions easier if they are one liners. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-27worktree: initialize return value for submodule_uses_worktreesLibravatar Stefan Beller1-1/+1
When the worktrees directory is empty, the `ret` will be returned uninitialized. Fix it by initializing the value. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-12submodule: add absorb-git-dir functionLibravatar Stefan Beller8-1/+282
When a submodule has its git dir inside the working dir, the submodule support for checkout that we plan to add in a later patch will fail. Add functionality to migrate the git directory to be absorbed into the superprojects git directory. The newly added code in this patch is structured such that other areas of Git can also make use of it. The code in the submodule--helper is a mere wrapper and option parser for the function `absorb_git_dir_into_superproject`, that takes care of embedding the submodules git directory into the superprojects git dir. That function makes use of the more abstract function for this use case `relocate_gitdir`, which can be used by e.g. the worktree code eventually to move around a git directory. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-12move connect_work_tree_and_git_dir to dir.hLibravatar Stefan Beller4-26/+26
That function was primarily used by submodule code, but the function itself is not inherently about submodules. In the next patch we'll introduce relocate_git_dir, which can be used by worktrees as well, so find a neutral middle ground in dir.h. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-12worktree: check if a submodule uses worktreesLibravatar Stefan Beller2-0/+55
In a later patch we want to move around the the git directory of a submodule. Both submodules as well as worktrees are involved in placing git directories at unusual places, so their functionality may collide. To react appropriately to situations where worktrees in submodules are in use, offer a new function to query the a submodule if it uses the worktree feature. An earlier approach: "Implement submodule_get_worktrees and just count them", however: This can be done cheaply (both in new code to write as well as run time) by obtaining the list of worktrees based off that submodules git directory. However as we have loaded the variables for the current repository, the values in the submodule worktree can be wrong, e.g. * core.ignorecase may differ between these two repositories * the ref resolution is broken (refs/heads/branch in the submodule resolves to the sha1 value of the `branch` in the current repository that may not exist or have another sha1) The implementation here is just checking for any files in $GIT_COMMON_DIR/worktrees for the submodule, which ought to be sufficient if the submodule is using the current repository format, which we also check. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-09test-lib-functions.sh: teach test_commit -C <dir>Libravatar Stefan Beller1-5/+15
Specifically when setting up submodule tests, it comes in handy if we can create commits in repositories that are not at the root of the tested trash dir. Add "-C <dir>" similar to gits -C parameter that will perform the operation in the given directory. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-09submodule helper: support super prefixLibravatar Stefan Beller2-12/+21
Just like main commands in Git, the submodule helper needs access to the superproject prefix. Enable this in the git.c but have its own fuse in the helper code by having a flag to turn on the super prefix. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-12-09submodule: use absolute path for computing relative path connectingLibravatar Stefan Beller1-6/+7
The current caller of connect_work_tree_and_git_dir passes an absolute path for the `git_dir` parameter. In the future patch we will also pass in relative path for `git_dir`. Extend the functionality of connect_work_tree_and_git_dir to take relative paths for parameters. We could work around this in the future patch by computing the absolute path for the git_dir in the calling site, however accepting relative paths for either parameter makes the API for this function much harder to misuse. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-11-28worktree list: keep the list sortedLibravatar Nguyễn Thái Ngọc Duy4-1/+36
It makes it easier to write tests for. But it should also be good for the user since locating a worktree by eye would be easier once they notice this. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-11-28worktree.c: get_worktrees() takes a new flag argumentLibravatar Nguyễn Thái Ngọc Duy5-8/+8
This is another no-op patch, in preparation for get_worktrees() to do optional things, like sorting. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-11-28get_worktrees() must return main worktree as first item even on errorLibravatar Nguyễn Thái Ngọc Duy3-9/+28
This is required by git-worktree.txt, stating that the main worktree is the first line (especially in --porcelain mode when we can't just change behavior at will). There's only one case when get_worktrees() may skip main worktree, when parse_ref() fails. Update the code so that we keep first item as main worktree and return something sensible in this case: - In user-friendly mode, since we're not constraint by anything, returning "(error)" should do the job (we already show "(detached HEAD)" which is not machine-friendly). Actually errors should be printed on stderr by parse_ref() (*) - In plumbing mode, we do not show neither 'bare', 'detached' or 'branch ...', which is possible by the format description if I read it right. Careful readers may realize that when the local variable "head_ref" in get_main_worktree() is emptied, add_head_info() will do nothing to wt->head_sha1. But that's ok because head_sha1 is zero-ized in the previous patch. (*) Well, it does not. But it's supposed to be a stop gap implementation until we can reuse refs code to parse "ref: " stuff in HEAD, from resolve_refs_unsafe(). Now may be the time since refs refactoring is mostly done. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-11-28worktree: reorder an if statementLibravatar Nguyễn Thái Ngọc Duy1-3/+3
This is no-op. But it helps reduce diff noise in the next patch. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-11-23worktree.c: zero new 'struct worktree' on allocationLibravatar Nguyễn Thái Ngọc Duy1-12/+2
This keeps things a bit simpler when we add more fields, knowing that default values are always zero. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-11-22Merge tag 'l10n-2.11.0-rnd2' of git://github.com/git-l10n/git-poLibravatar Junio C Hamano8-16103/+23112
l10n-2.11.0-rnd2 * tag 'l10n-2.11.0-rnd2' of git://github.com/git-l10n/git-po: l10n: Fixed typo of git fetch-pack command l10n: git.pot: v2.11.0 round 2 (1 new, 1 removed) l10n: zh_CN: for git v2.11.0 l10n round 1 l10n: pt_PT: update Portuguese translation l10n: fr.po fix grammar mistakes l10n: fr.po v2.11.0_rnd1 l10n: sv.po: Update Swedish translation (2913t0f0u) l10n: vi.po: Updated translation to v2.11.0 (2913t) l10n: ko.po: Update Korean translation l10n: git.pot: v2.11.0 round 1 (209 new, 53 removed) l10n: ru.po: update Russian translation
2016-11-22Merge branch 'js/prepare-sequencer'Libravatar Junio C Hamano1-1/+1
Fix for an error message string. * js/prepare-sequencer: i18n: fix unmatched single quote in error message
2016-11-22l10n: Fixed typo of git fetch-pack commandLibravatar Jiang Xin6-183/+282
Git 2.11.0-rc2 introduced one small l10n update, and this commit fixed the affected translations all in one batch. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2016-11-22l10n: git.pot: v2.11.0 round 2 (1 new, 1 removed)Libravatar Jiang Xin1-9/+9
Generate po/git.pot from v2.11.0-rc2 for git v2.11.0 l10n round 2. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2016-11-22Merge branch 'master' of git://github.com/git-l10n/git-poLibravatar Jiang Xin8-16066/+22976
* 'master' of git://github.com/git-l10n/git-po: l10n: zh_CN: for git v2.11.0 l10n round 1 l10n: pt_PT: update Portuguese translation l10n: fr.po fix grammar mistakes l10n: fr.po v2.11.0_rnd1 l10n: sv.po: Update Swedish translation (2913t0f0u) l10n: vi.po: Updated translation to v2.11.0 (2913t) l10n: ko.po: Update Korean translation l10n: git.pot: v2.11.0 round 1 (209 new, 53 removed) l10n: ru.po: update Russian translation
2016-11-21i18n: fix unmatched single quote in error messageLibravatar Jiang Xin1-1/+1
Fixed unmatched single quote introduced by commit: * f56fffef9a sequencer: teach write_message() to append an optional LF Signed-off-by: Jiang Xin <worldhello.net@gmail.com> Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-11-21l10n: zh_CN: for git v2.11.0 l10n round 1Libravatar Jiang Xin1-2002/+2897
Update 209 translations (2913t0f0u) for git v2.11.0-rc0. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2016-11-17Git 2.11-rc2Libravatar Junio C Hamano2-1/+4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-11-17Merge branch 'tk/diffcore-delta-remove-unused'Libravatar Junio C Hamano5-8/+1
Code cleanup. * tk/diffcore-delta-remove-unused: diffcore-delta: remove unused parameter to diffcore_count_changes()
2016-11-17Merge branch 'jk/create-branch-remove-unused-param'Libravatar Junio C Hamano4-13/+18
Code clean-up. * jk/create-branch-remove-unused-param: create_branch: drop unused "head" parameter
2016-11-17Merge branch 'nd/worktree-lock'Libravatar Junio C Hamano1-1/+1
Typofix. * nd/worktree-lock: git-worktree.txt: fix typo "to"/"two", and add comma
2016-11-14diffcore-delta: remove unused parameter to diffcore_count_changes()Libravatar Tobias Klauser5-8/+1
The delta_limit parameter to diffcore_count_changes() has been unused since commit ba23bbc8e ("diffcore-delta: make change counter to byte oriented again.", 2006-03-04). Remove the parameter and adjust all callers. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-11-13git-worktree.txt: fix typo "to"/"two", and add commaLibravatar Ben North1-1/+1
Signed-off-by: Ben North <ben@redfrontdoor.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-11-13l10n: pt_PT: update Portuguese translationLibravatar Vasco Almeida1-2027/+2947
Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
2016-11-11Git 2.11.0-rc1Libravatar Junio C Hamano1-0/+7
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-11-11Merge branch 'rt/fetch-pack-error-message-fix'Libravatar Junio C Hamano1-1/+1
An error message in fetch-pack executable that was newly marked for translation was misspelt, which has been fixed. * rt/fetch-pack-error-message-fix: fetch-pack.c: correct command at the beginning of an error message
2016-11-11Merge branch 'ps/common-info-doc'Libravatar Junio C Hamano1-1/+1
Doc fix. * ps/common-info-doc: doc: fix location of 'info/' with $GIT_COMMON_DIR
2016-11-11Merge branch 'js/pwd-var-vs-pwd-cmd-fix'Libravatar Junio C Hamano2-3/+3
Last minute fixes to two fixups merged to 'master' recently. * js/pwd-var-vs-pwd-cmd-fix: t0021, t5615: use $PWD instead of $(pwd) in PATH-like shell variables
2016-11-11Merge branch 'ls/macos-update'Libravatar Junio C Hamano2-1/+3
Portability update and workaround for builds on recent Mac OS X. * ls/macos-update: travis-ci: disable GIT_TEST_HTTPD for macOS Makefile: set NO_OPENSSL on macOS by default
2016-11-11Merge branch 'js/prepare-sequencer'Libravatar Junio C Hamano1-1/+1
Silence a clang warning introduced by a recently graduated topic. * js/prepare-sequencer: sequencer: silence -Wtautological-constant-out-of-range-compare
2016-11-11Merge branch 'ls/filter-process'Libravatar Junio C Hamano1-2/+1
Test portability improvements and optimization for an already-graduated topic. * ls/filter-process: t0021: remove debugging cruft
2016-11-11Merge branch 'as/merge-attr-sleep'Libravatar Junio C Hamano1-5/+13
Fix for a racy false-positive test failure. * as/merge-attr-sleep: t6026: clarify the point of "kill $(cat sleep.pid)" t6026: ensure that long-running script really is Revert "t6026-merge-attr: don't fail if sleep exits early" Revert "t6026-merge-attr: ensure that the merge driver was called" t6026-merge-attr: ensure that the merge driver was called t6026-merge-attr: don't fail if sleep exits early
2016-11-11fetch-pack.c: correct command at the beginning of an error messageLibravatar Ralf Thielow1-1/+1
One error message in fetch-pack.c uses 'git fetch_pack' at the beginning which is not a git command. Use 'git fetch-pack' instead. Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-11-11t0021: remove debugging cruftLibravatar Junio C Hamano1-2/+1
The redirection of the standard error stream to a temporary file is a leftover cruft during debugging. Remove it. Besides, it is reported by folks on the Windows that the test is flaky with this redirection; somebody gets confused and this merely-redirected-to file gets marked as delete-pending by git.exe and makes it finish with a non-zero exit status when "git checkout" finishes. Windows folks may want to figure that one out, but for the purpose of this test, it shouldn't become a show-stopper. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-11-11t6026: clarify the point of "kill $(cat sleep.pid)"Libravatar Johannes Sixt1-1/+9
We lengthened the time the leftover process sleeps in the previous commit to make sure it will be there while 'git merge' runs and finishes. It therefore needs to be killed before leaving the test. And it needs to be killed even when 'git merge' fails, so it has to be triggered via test_when_finished mechanism. Explain all that in a large comment, and move the use site of test_when_finished to immediately before 'git merge' invocation, where the process is spawned. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-11-11t0021, t5615: use $PWD instead of $(pwd) in PATH-like shell variablesLibravatar Johannes Sixt2-3/+3
We have to use $PWD instead of $(pwd) because on Windows the latter would add a C: style path to bash's Unix-style $PATH variable, which becomes confused by the colon after the drive letter. ($PWD is a Unix-style path.) In the case of GIT_ALTERNATE_OBJECT_DIRECTORIES, bash on Windows assembles a Unix-style path list with the colon as separators. It converts the value to a Windows-style path list with the semicolon as path separator when it forwards the variable to git.exe. The same confusion happens when bash's original value is contaminated with Windows style paths. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-11-11doc: fix location of 'info/' with $GIT_COMMON_DIRLibravatar Patrick Steinhardt1-1/+1
With the introduction of the $GIT_COMMON_DIR variable, the repository layout manual was changed to reflect the location for many files in case the variable is set. While adding the new locations, one typo snuck in regarding the location of the 'info/' folder, which is falsely claimed to reside at "$GIT_COMMON_DIR/index". Fix the typo to point to "$GIT_COMMON_DIR/info/" instead. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-11-10t6026: ensure that long-running script really isLibravatar Johannes Schindelin1-4/+4
When making sure that background tasks are cleaned up in 5babb5b (t6026-merge-attr: clean up background process at end of test case, 2016-09-07), we considered to let the background task sleep longer, just to be certain that it will still be running when we want to kill it after the test. Sadly, the assumption appears not to hold true that the test case passes quickly enough to kill the background task within a second. Simply increase it to an hour. No system can be possibly slow enough to make above-mentioned assumption incorrect. Reported by Andreas Schwab. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-11-10Revert "t6026-merge-attr: don't fail if sleep exits early"Libravatar Junio C Hamano1-1/+1
This reverts commit 734fde2d7167e4b20d2ff6062ade3846949b0741. The point of the test is that the stray process was still running when 'git merge' did its thing through its completion, so a failure to "kill" it means we didn't give a condition to the test to trigger a possible future breakage. Appending "|| :" to the "kill" is sweeping a test-bug under the rug.
2016-11-10Revert "t6026-merge-attr: ensure that the merge driver was called"Libravatar Junio C Hamano1-2/+1
This reverts commit c1e0dc59bddce765761a6f863c66ee0cd4b2ca09. We are not interested in the stray process in the merge driver started; we want it to be still around.
2016-11-10Merge branch 'jk/alt-odb-cleanup'Libravatar Junio C Hamano2-1/+72
Fix a corner-case regression in a topic that graduated during the v2.11 cycle. * jk/alt-odb-cleanup: alternates: re-allow relative paths from environment
2016-11-10Merge branch 'jk/filter-process-fix'Libravatar Junio C Hamano2-15/+17
Test portability improvements and cleanups for t0021. * jk/filter-process-fix: t0021: fix filehandle usage on older perl t0021: use $PERL_PATH for rot13-filter.pl t0021: put $TEST_ROOT in $PATH t0021: use write_script to create rot13 shell script
2016-11-10Merge branch 'ls/filter-process'Libravatar Junio C Hamano1-5/+4
Test portability improvements and optimization for an already-graduated topic. * ls/filter-process: t0021: compute file size with a single process instead of a pipeline t0021: expect more variations in the output of uniq -c
2016-11-10t6026-merge-attr: ensure that the merge driver was calledLibravatar Andreas Schwab1-1/+2
Explicitly check for the existence of the pid file to test that the merge driver was actually called. Signed-off-by: Andreas Schwab <schwab@suse.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-11-10travis-ci: disable GIT_TEST_HTTPD for macOSLibravatar Lars Schneider1-1/+2
TravisCI changed their default macOS image from 10.10 to 10.11 [1]. Unfortunately the HTTPD tests do not run out of the box using the pre-installed Apache web server anymore. Therefore we enable these tests only for Linux and disable them for macOS. [1] https://blog.travis-ci.com/2016-10-04-osx-73-default-image-live/ Signed-off-by: Lars Schneider <larsxschneider@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-11-10Makefile: set NO_OPENSSL on macOS by defaultLibravatar Lars Schneider1-0/+1
Apple removed the OpenSSL header files in macOS 10.11 and above. OpenSSL was deprecated since macOS 10.7. Set `NO_OPENSSL` and `APPLE_COMMON_CRYPTO` to `YesPlease` as default for macOS. It is possible to override this and use OpenSSL by defining `NO_APPLE_COMMON_CRYPTO`. Original-patch-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Lars Schneider <larsxschneider@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-11-09create_branch: drop unused "head" parameterLibravatar Jeff King4-13/+18
This function used to have the caller pass in the current value of HEAD, in order to make sure we didn't clobber HEAD. In 55c4a6730, that logic moved to validate_new_branchname(), which just resolves HEAD itself. The parameter to create_branch is now unused. Since we have to update and re-wrap the docstring describing the parameters anyway, let's take this opportunity to break it out into a list, which makes it easier to find the parameters. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>