summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* alias: use the early config machinery to expand aliasesjs/alias-early-configJohannes Schindelin2017-06-153-59/+26
| | | | | | | | | | | | | | | | | | | | | | Instead of discovering the .git/ directory, reading the config and then trying to painstakingly reset all the global state if we did not find a matching alias, let's use the early config machinery instead. It may look like unnecessary work to discover the .git/ directory in the early config machinery and then call setup_git_directory_gently() in the case of a shell alias, repeating the very same discovery *again*. However, we have to do this as the early config machinery takes pains *not* to touch any global state, while shell aliases expect a possibly changed working directory and at least the GIT_PREFIX and GIT_DIR variables to be set. This change also fixes a known issue where Git tried to read the pager config from an incorrect path in a subdirectory of a Git worktree if an alias expanded to a shell command. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t7006: demonstrate a problem with aliases in subdirectoriesJohannes Schindelin2017-06-151-0/+11
| | | | | | | | | | | | | | | | | | | | When expanding aliases, the git_dir is set during the alias expansion (by virtue of running setup_git_directory_gently()). This git_dir may be relative to the current working directory, and indeed often is simply ".git/". When the alias expands to a shell command, we restore the original working directory, though, yet we do not reset git_dir. As a consequence, subsequent read_early_config() runs will mistake the git_dir to be populated properly and not find the correct config. Demonstrate this problem by adding a test case. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* t1308: relax the test verifying that empty alias values are disallowedJohannes Schindelin2017-06-151-1/+3
| | | | | | | | | | | | | | | | We are about to change the way aliases are expanded, to use the early config machinery. This machinery reports errors in a slightly different manner than the cached config machinery. Let's not get hung up by the precise wording of the message mentioning the line number. It is really sufficient to verify that all the relevant information is given to the user. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* help: use early config when autocorrecting aliasesJohannes Schindelin2017-06-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Git has this feature which suggests similar commands (including aliases) in case the user specified an unknown command. This feature currently relies on a side effect of the way we expand aliases right now: when a command is not a builtin, we use the regular config machinery (meaning: discovering the .git/ directory and initializing global state such as the config cache) to see whether the command refers to an alias. However, we will change the way aliases are expanded in the next commits, to use the early config instead. That means that the autocorrect feature can no longer discover the available aliases by looking at the config cache (because it has not yet been initialized). So let's just use the early config machinery instead. This is slightly less performant than the previous way, as the early config is used *twice*: once to see whether the command refers to an alias, and then to see what aliases are most similar. However, this is hardly a performance-critical code path, so performance is less important here. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* config: report correct line number upon errorJohannes Schindelin2017-06-152-1/+8
| | | | | | | | | | | | | | | | | When get_value() parses a key/value pair, it is possible that the line number is decreased (because the \n has been consumed already) before the key/value pair is passed to the callback function, to allow for the correct line to be attributed in case of an error. However, when git_parse_source() asks get_value() to parse the key/value pair, the error reporting is performed *after* get_value() returns. Which means that we have to be careful not to increase the line number in get_value() after the callback function returned an error. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* discover_git_directory(): avoid setting invalid git_dirJohannes Schindelin2017-06-151-0/+1
| | | | | | | | | | | | | | | | | | | | | When discovering a .git/ directory, we take pains to ensure that its repository format version matches Git's expectations, and we return NULL otherwise. However, we still appended the invalid path to the strbuf passed as argument. Let's just reset the strbuf to the state before we appended the .git/ directory that was eventually rejected. There is another early return path in that function, when setup_git_directory_gently_1() returns GIT_DIR_NONE or an error. In that case, the gitdir parameter has not been touched, therefore there is no need for an equivalent change in that code path. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Reviewed-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Git 2.13v2.13.0Junio C Hamano2017-05-093-1/+14
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge tag 'l10n-2.13.0-rnd2.1' of git://github.com/git-l10n/git-poJunio C Hamano2017-05-099-19174/+23732
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | l10n for Git 2.13.0 round 2.1 * tag 'l10n-2.13.0-rnd2.1' of git://github.com/git-l10n/git-po: l10n: zh_CN: for git v2.13.0 l10n round 2 l10n: sv.po: Update Swedish translation (3195t0f0u) l10n: zh_CN: review for git v2.13.0 l10n round 1 l10n: Update Catalan translation l10n: bg.po: Updated Bulgarian translation (3195t) l10n: fr.po v2.13 rnd 2 l10n: de.po: translate 4 new messages l10n: de.po: update German translation l10n: de.po: lower case after semi-colon l10n: vi.po(3195t): Update translation for v2.13.0 round 2 l10n: git.pot: v2.13.0 round 2 (4 new, 7 removed) l10n: zh_CN: for git v2.13.0 l10n round 1 l10n: fr.po v2.13 round 1 l10n: pt_PT: update Portuguese translation l10n: bg.po: Updated Bulgarian translation (3201t) l10n: vi.po(3198t): Updated Vietnamese translation for v2.13.0-rc0 l10n: sv.po: Update Swedish translation (3199t0f0u) l10n: git.pot: v2.13.0 round 1 (96 new, 37 removed)
| * Merge branch 'master' of git://github.com/nafmo/git-l10n-svJiang Xin2017-05-091-434/+439
| |\ | | | | | | | | | | | | * 'master' of git://github.com/nafmo/git-l10n-sv: l10n: sv.po: Update Swedish translation (3195t0f0u)
| | * l10n: sv.po: Update Swedish translation (3195t0f0u)Peter Krefting2017-05-091-434/+439
| | | | | | | | | | | | Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
| * | l10n: zh_CN: for git v2.13.0 l10n round 2Jiang Xin2017-05-091-429/+436
| |/ | | | | | | | | | | Translate 4 messages (3195t0f0u) for git v2.13.0-rc2. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
| * l10n: zh_CN: review for git v2.13.0 l10n round 1Ray Chen2017-05-091-17/+17
| | | | | | | | Signed-off-by: Ray Chen <oldsharp@gmail.com>
| * Merge branch 'master' of https://github.com/vnwildman/gitJiang Xin2017-05-091-431/+438
| |\ | | | | | | | | | | | | * 'master' of https://github.com/vnwildman/git: l10n: vi.po(3195t): Update translation for v2.13.0 round 2
| | * l10n: vi.po(3195t): Update translation for v2.13.0 round 2Tran Ngoc Quan2017-05-051-431/+438
| | | | | | | | | | | | Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
| * | l10n: Update Catalan translationJordi Mas2017-05-091-2126/+2491
| | | | | | | | | | | | Signed-off-by: Jordi Mas <jmas@softcatala.org>
| * | l10n: bg.po: Updated Bulgarian translation (3195t)Alexander Shopov2017-05-091-85/+61
| | | | | | | | | | | | Signed-off-by: Alexander Shopov <ash@kambanaria.org>
| * | Merge branch 'fr_l10n_v2.13_rnd2' of git://github.com/jnavila/gitJiang Xin2017-05-091-448/+478
| |\ \ | | | | | | | | | | | | | | | | * 'fr_l10n_v2.13_rnd2' of git://github.com/jnavila/git: l10n: fr.po v2.13 rnd 2
| | * | l10n: fr.po v2.13 rnd 2Jean-Noel Avila2017-05-061-448/+478
| | |/ | | | | | | | | | Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
| * | l10n: de.po: translate 4 new messagesRalf Thielow2017-05-051-440/+465
| | | | | | | | | | | | | | | | | | | | | | | | Translate 4 new messages came from git.pot update in 28e1aaa48 (l10n: git.pot: v2.13.0 round 2 (4 new, 7 removed)). Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Acked-by: Matthias Rüster <matthias.ruester@gmail.com>
| * | l10n: de.po: update German translationRalf Thielow2017-05-051-1989/+2381
| | | | | | | | | | | | | | | | | | | | | | | | Translate 96 new messages came from git.pot update in dfc182b (l10n: git.pot: v2.13.0 round 1 (96 new, 37 removed)). Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Acked-by: Matthias Rüster <matthias.ruester@gmail.com>
| * | l10n: de.po: lower case after semi-colonMichael J Gruber2017-05-051-1/+1
| |/ | | | | | | | | Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
| * l10n: git.pot: v2.13.0 round 2 (4 new, 7 removed)Jiang Xin2017-05-051-428/+417
| | | | | | | | | | | | Generate po/git.pot from v2.13.0-rc2 for git v2.13.0 l10n round 2. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
| * Merge branch 'master' of git://github.com/git-l10n/git-poJiang Xin2017-05-057-14167/+17929
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'master' of git://github.com/git-l10n/git-po: l10n: zh_CN: for git v2.13.0 l10n round 1 l10n: fr.po v2.13 round 1 l10n: pt_PT: update Portuguese translation l10n: bg.po: Updated Bulgarian translation (3201t) l10n: vi.po(3198t): Updated Vietnamese translation for v2.13.0-rc0 l10n: sv.po: Update Swedish translation (3199t0f0u) l10n: git.pot: v2.13.0 round 1 (96 new, 37 removed)
| | * l10n: zh_CN: for git v2.13.0 l10n round 1Jiang Xin2017-05-051-1947/+2303
| | | | | | | | | | | | | | | | | | | | | Translate 96 messages (3198t0f0u) for git v2.13.0-rc0. Reviewed-by: 依云 <lilydjwg@gmail.com> Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
| | * Merge branch 'fr_l10n_v2.13_rnd1' of git://github.com/jnavila/gitJiang Xin2017-05-051-1943/+2285
| | |\ | | | | | | | | | | | | | | | | * 'fr_l10n_v2.13_rnd1' of git://github.com/jnavila/git: l10n: fr.po v2.13 round 1
| | | * l10n: fr.po v2.13 round 1Jean-Noel Avila2017-05-021-1943/+2285
| | | | | | | | | | | | | | | | Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
| | * | l10n: pt_PT: update Portuguese translationVasco Almeida2017-05-011-2057/+2471
| | | | | | | | | | | | | | | | Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
| | * | l10n: bg.po: Updated Bulgarian translation (3201t)Alexander Shopov2017-04-301-2423/+4086
| | | | | | | | | | | | | | | | Signed-off-by: Alexander Shopov <ash@kambanaria.org>
| | * | Merge branch 'master' of https://github.com/vnwildman/gitJiang Xin2017-04-291-1946/+2299
| | |\ \ | | | | | | | | | | | | | | | | | | | | * 'master' of https://github.com/vnwildman/git: l10n: vi.po(3198t): Updated Vietnamese translation for v2.13.0-rc0
| | | * | l10n: vi.po(3198t): Updated Vietnamese translation for v2.13.0-rc0Tran Ngoc Quan2017-04-251-1946/+2299
| | | |/ | | | | | | | | | | | | Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
| | * | l10n: sv.po: Update Swedish translation (3199t0f0u)Peter Krefting2017-04-231-1938/+2294
| | |/ | | | | | | | | | Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
| | * l10n: git.pot: v2.13.0 round 1 (96 new, 37 removed)Jiang Xin2017-04-231-1913/+2191
| | | | | | | | | | | | | | | | | | Generate po/git.pot from v2.13.0-rc0 for git v2.13.0 l10n round 1. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
* | | Sync with v2.12.3Junio C Hamano2017-05-0811-11/+116
|\ \ \ | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | Git 2.12.3v2.12.3Junio C Hamano2017-05-053-4/+12
| | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | Merge branch 'maint-2.11' into maintJunio C Hamano2017-05-0510-8/+105
| |\ \ \
| | * | | Git 2.11.2v2.11.2Junio C Hamano2017-05-054-3/+16
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| | * | | Merge branch 'maint-2.10' into maint-2.11Junio C Hamano2017-05-059-8/+92
| | |\ \ \
| | | * | | Git 2.10.3v2.10.3Junio C Hamano2017-05-053-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| | | * | | Merge branch 'maint-2.9' into maint-2.10Junio C Hamano2017-05-058-7/+83
| | | |\ \ \
| | | | * | | Git 2.9.4v2.9.4Junio C Hamano2017-05-053-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| | | | * | | Merge branch 'maint-2.8' into maint-2.9Junio C Hamano2017-05-057-6/+74
| | | | |\ \ \
| | | | | * | | Git 2.8.5v2.8.5Junio C Hamano2017-05-054-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| | | | | * | | Merge branch 'maint-2.7' into maint-2.8Junio C Hamano2017-05-056-5/+60
| | | | | |\ \ \
| | | | | | * | | Git 2.7.5v2.7.5Junio C Hamano2017-05-054-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| | | | | | * | | Merge branch 'maint-2.6' into maint-2.7Junio C Hamano2017-05-055-4/+43
| | | | | | |\ \ \
| | | | | | | * | | Git 2.6.7v2.6.7maint-2.6Junio C Hamano2017-05-054-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| | | | | | | * | | Merge branch 'maint-2.5' into maint-2.6Junio C Hamano2017-05-054-3/+29
| | | | | | | |\ \ \
| | | | | | | | * | | Git 2.5.6v2.5.6maint-2.5Junio C Hamano2017-05-054-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| | | | | | | | * | | Merge branch 'maint-2.4' into maint-2.5Junio C Hamano2017-05-053-2/+15
| | | | | | | | |\ \ \
| | | | | | | | | * | | Git 2.4.12v2.4.12maint-2.4Junio C Hamano2017-05-054-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>