summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-09-22diff-highlight: correctly match blank lines for flushJeff King
We try to flush the output from diff-highlight whenever we see a blank line. That lets you see the output for each commit as soon as it is generated, even if Git is still chugging away at a diff, or traversing to find the next commit. However, our "blank line" match checks length($_). That won't ever be true, because we haven't chomped the line ending. As a result, we never flush. Instead, let's use a simple regex which handles line endings in with the end-of-line marker. This has been broken since the initial version in 927a13fe87 (contrib: add diff highlight script, 2011-10-18). Probably nobody noticed because: - most output is big enough, or comes fast enough, that it flushes anyway. And it can be difficult to notice the difference between "show a commit, then pause" and "pause, then show two commits". I only noticed because I was viewing "git log" output on a repo with a very slow textconv filter. - if stdout is going to the terminal (and not another pager like less), then the flush isn't necessary. So any manual testing would show it appearing to work. You can easily see the difference with something like: echo '* diff=slow' >>.gitattributes git -c diff.slow.textconv='sleep 1; cat' \ -c pager.log='diff-highlight | less' \ log -p That should generate one commit every second or so (more if it touches multiple files), but without this patch it waits for many seconds before generating several pages of output. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-27Git 2.28v2.28.0Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-26Merge tag 'l10n-2.28.0-rnd1' of https://www.github.com/git-l10n/git-po into ↵Junio C Hamano
master l10n-2.28.0-rnd1 * tag 'l10n-2.28.0-rnd1' of https://www.github.com/git-l10n/git-po: l10n: es: 2.28.0 round 1 l10n: de.po: Update German translation for Git v2.28.0 l10n: de.po: fix grammar l10n: zh_CN: for git v2.28.0 l10n round 1 l10n: zh_TW.po: v2.28.0 round 1 (0 untranslated) l10n: vi.po: correct "ident line" translation l10n: vi.po(4931t): Updated translation for v2.28.0 l10n: fr v2.28.0 round 1 l10n: sv.po: Update Swedish translation (4931t0f0u) l10n: it.po: update the Italian translation for Git 2.28.0 round 1 l10n: tr: v2.28.0 round 1 l10n: git.pot: v2.28.0 round 1 (70 new, 14 removed) l10n: Update Catalan translation
2020-07-26Merge branch 'master' of github.com:Softcatala/git-poJiang Xin
* 'master' of github.com:Softcatala/git-po: l10n: Update Catalan translation
2020-07-26l10n: es: 2.28.0 round 1Christopher Diaz Riveros
Signed-off-by: Christopher Diaz Riveros <christopher.diaz.riv@gmail.com>
2020-07-24Merge branch 'ps/ref-transaction-hook' into masterJunio C Hamano
A new hook. * ps/ref-transaction-hook: githooks.txt: use correct "reference-transaction" hook name
2020-07-24githooks.txt: use correct "reference-transaction" hook nameBojun Chen
The "reference transaction" hook was introduced in commit 6754159767 (refs: implement reference transaction hook, 2020-06-19). The name of the hook is declared as "reference-transaction" in "refs.c" and testcases, but the name declared in "githooks.txt" is different. Signed-off-by: Bojun Chen <bojun.cbj@alibaba-inc.com> Reviewed-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-24l10n: de.po: Update German translation for Git v2.28.0Matthias Rüster
Reviewed-by: Ralf Thielow <ralf.thielow@gmail.com> Signed-off-by: Matthias Rüster <matthias.ruester@gmail.com>
2020-07-24l10n: de.po: fix grammarRalf Thielow
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Signed-off-by: Matthias Rüster <matthias.ruester@gmail.com>
2020-07-22Documentation/RelNotes: fix a typo in 2.28's relnotesTaylor Blau
Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-22Git 2.28-rc2v2.28.0-rc2Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-21Merge branch 'en/sparse-status' into masterJunio C Hamano
Fix to a "git prompt" regression during this development cycle. * en/sparse-status: git-prompt: change == to = for zsh's sake
2020-07-21l10n: zh_CN: for git v2.28.0 l10n round 1Jiang Xin
Translate 70 new messages (4931t0f0u) for git 2.28.0. Reviewed-by: Fangyi Zhou <me@fangyi.io> Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2020-07-21Merge branch 'l10n/zh_TW/200716' of github.com:l10n-tw/git-poJiang Xin
* 'l10n/zh_TW/200716' of github.com:l10n-tw/git-po: l10n: zh_TW.po: v2.28.0 round 1 (0 untranslated)
2020-07-21git-prompt: change == to = for zsh's sakeDavid J. Malan
When using git-prompt.sh with zsh, __git_ps1 currently errs when inside a repo with: __git_ps1:96: = not found Avoid using non-portable "==" that is only understood by bash and not zsh. Change to "=" so that the prompt script becomes usable with zsh again. Signed-off-by: David J. Malan <malan@harvard.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-20Merge https://github.com/prati0100/git-gui into masterJunio C Hamano
* https://github.com/prati0100/git-gui: git-gui: allow opening work trees from the startup dialog
2020-07-20l10n: zh_TW.po: v2.28.0 round 1 (0 untranslated)Yi-Jyun Pan
Signed-off-by: Yi-Jyun Pan <pan93412@gmail.com>
2020-07-20l10n: vi.po: correct "ident line" translationĐoàn Trần Công Danh
While we're at it, fix some minor misspelling and improve translation for 3-way-merging. Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com> Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
2020-07-20l10n: vi.po(4931t): Updated translation for v2.28.0Tran Ngoc Quan
Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
2020-07-18Merge branch 'dl/branch-cleanup' into masterJunio C Hamano
Last minute fix-up to tests for portability. * dl/branch-cleanup: t3200: don't grep for `strerror()` string
2020-07-18Merge branch 'js/pu-to-seen' into masterJunio C Hamano
Last minute fix-up to documentation. * js/pu-to-seen: gitworkflows.txt: fix broken subsection underline
2020-07-18Merge branch 'jc/relnotes-v0-extension-update' into masterJunio C Hamano
Last minute fix-up to the release notes. * jc/relnotes-v0-extension-update: RelNotes: update the v0 with extension situation
2020-07-18t3200: don't grep for `strerror()` stringMartin Ågren
In 6b7093064a ("t3200: test for specific errors", 2020-06-15), we learned to grep stderr to ensure that the failing `git branch` invocations fail for the right reason. In two of these tests, we grep for "File exists", expecting the string to show up there since config.c calls `error_errno()`, which ends up including `strerror(errno)` in the error message. But as we saw in 4605a73073 ("t1091: don't grep for `strerror()` string", 2020-03-08), there exists at least one implementation where `strerror()` yields a slightly different string than the one we're grepping for. In particular, these tests fail on the NonStop platform. Similar to 4605a73073, grep for the beginning of the string instead to avoid relying on `strerror()` behavior. Reported-by: Randall S. Becker <rsbecker@nexbridge.com> Signed-off-by: Martin Ågren <martin.agren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-18gitworkflows.txt: fix broken subsection underlineMartin Ågren
AsciiDoctor renders the "~~~~~~~~~" literally. That's not our intention: it is supposed to indicate a level 2 subsection. In 828197de8f ("docs: adjust for the recent rename of `pu` to `seen`", 2020-06-25), the length of this section header grew by two characters but we didn't adjust the number of ~ characters accordingly. AsciiDoc handles this discrepancy ok and still picks this up as a subsection title, but Asciidoctor is not as forgiving. Signed-off-by: Martin Ågren <martin.agren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-17RelNotes: update the v0 with extension situationJunio C Hamano
With the two-patch series for regression fix, to the users from 2.27 days, there is no visible behaviour change---we do not warn and fail use of v0 repositories with newer extensions yet, so there is nothing to note in the backward compatibility section. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-17Git 2.28-rc1v2.28.0-rc1Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-17Merge branch 'jn/v0-with-extensions-fix' into masterJunio C Hamano
In 2.28-rc0, we corrected a bug that some repository extensions are honored by mistake even in a version 0 repositories (these configuration variables in extensions.* namespace were supposed to have special meaning in repositories whose version numbers are 1 or higher), but this was a bit too big a change. * jn/v0-with-extensions-fix: repository: allow repository format upgrade with extensions Revert "check_repository_format_gently(): refuse extensions for old repositories"
2020-07-16repository: allow repository format upgrade with extensionsJonathan Nieder
Now that we officially permit repository extensions in repository format v0, permit upgrading a repository with extensions from v0 to v1 as well. For example, this means a repository where the user has set "extensions.preciousObjects" can use "git fetch --filter=blob:none origin" to upgrade the repository to use v1 and the partial clone extension. To avoid mistakes, continue to forbid repository format upgrades in v0 repositories with an unrecognized extension. This way, a v0 user using a misspelled extension field gets a chance to correct the mistake before updating to the less forgiving v1 format. While we're here, make the error message for failure to upgrade the repository format a bit shorter, and present it as an error, not a warning. Reported-by: Huan Huan Chen <huanhuanchen@google.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-16Revert "check_repository_format_gently(): refuse extensions for old ↵Jonathan Nieder
repositories" This reverts commit 14c7fa269e42df4133edd9ae7763b678ed6594cd. The core.repositoryFormatVersion field was introduced in ab9cb76f661 (Repository format version check., 2005-11-25), providing a welcome bit of forward compatibility, thanks to some welcome analysis by Martin Atukunda. The semantics are simple: a repository with core.repositoryFormatVersion set to 0 should be comprehensible by all Git implementations in active use; and Git implementations should error out early instead of trying to act on Git repositories with higher core.repositoryFormatVersion values representing new formats that they do not understand. A new repository format did not need to be defined until 00a09d57eb8 (introduce "extensions" form of core.repositoryformatversion, 2015-06-23). This provided a finer-grained extension mechanism for Git repositories. In a repository with core.repositoryFormatVersion set to 1, Git implementations can act on "extensions.*" settings that modify how a repository is interpreted. In repository format version 1, unrecognized extensions settings cause Git to error out. What happens if a user sets an extension setting but forgets to increase the repository format version to 1? The extension settings were still recognized in that case; worse, unrecognized extensions settings do *not* cause Git to error out. So combining repository format version 0 with extensions settings produces in some sense the worst of both worlds. To improve that situation, since 14c7fa269e4 (check_repository_format_gently(): refuse extensions for old repositories, 2020-06-05) Git instead ignores extensions in v0 mode. This way, v0 repositories get the historical (pre-2015) behavior and maintain compatibility with Git implementations that do not know about the v1 format. Unfortunately, users had been using this sort of configuration and this behavior change came to many as a surprise: - users of "git config --worktree" that had followed its advice to enable extensions.worktreeConfig (without also increasing the repository format version) would find their worktree configuration no longer taking effect - tools such as copybara[*] that had set extensions.partialClone in existing repositories (without also increasing the repository format version) would find that setting no longer taking effect The behavior introduced in 14c7fa269e4 might be a good behavior if we were traveling back in time to 2015, but we're far too late. For some reason I thought that it was what had been originally implemented and that it had regressed. Apologies for not doing my research when 14c7fa269e4 was under development. Let's return to the behavior we've had since 2015: always act on extensions.* settings, regardless of repository format version. While we're here, include some tests to describe the effect on the "upgrade repository version" code path. [*] https://github.com/google/copybara/commit/ca76c0b1e13c4e36448d12c2aba4a5d9d98fb6e7 Reported-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-15Hopefully the last batch before -rc1Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-15Merge branch 'tb/commit-graph-no-check-oids' into masterJunio C Hamano
Fix to the code to produce progress bar, which is new in the upcoming release. * tb/commit-graph-no-check-oids: commit-graph: fix "Collecting commits from input" progress line
2020-07-15Merge branch 'ct/diff-with-merge-base-clarification' into masterJunio C Hamano
Doc update. * ct/diff-with-merge-base-clarification: git-diff.txt: reorder possible usages git-diff.txt: don't mark required argument as optional
2020-07-15Merge branch 'sg/commit-graph-progress-fix' into masterJunio C Hamano
The code to produce progress output from "git commit-graph --write" had a few breakages, which have been fixed. * sg/commit-graph-progress-fix: commit-graph: fix "Writing out commit graph" progress counter commit-graph: fix progress of reachable commits
2020-07-15Merge branch 'ta/wait-on-aliased-commands-upon-signal' into masterJunio C Hamano
When an aliased command, whose output is piped to a pager by git, gets killed by a signal, the pager got into a funny state, which has been corrected (again). * ta/wait-on-aliased-commands-upon-signal: Wait for child on signal death for aliases to externals Wait for child on signal death for aliases to builtins
2020-07-15commit-graph: fix "Collecting commits from input" progress lineSZEDER Gábor
To display a progress line while reading commits from standard input and looking them up, 5b6653e523 (builtin/commit-graph.c: dereference tags in builtin, 2020-05-13) should have added a pair of start_delayed_progress() and stop_progress() calls around the loop reading stdin. Alas, the stop_progress() call ended up at the wrong place, after write_commit_graph(), which does all the commit-graph computation and writing, and has several progress lines of its own. Consequently, that new Collecting commits from input: 1234 progress line is overwritten by the first progress line shown by write_commit_graph(), and its final "done" line is shown last, after everything is finished: $ { sleep 3 ; git rev-list -3 HEAD ; sleep 1 ; } | ~/src/git/git commit-graph write --stdin-commits Expanding reachable commits in commit graph: 873402, done. Writing out commit graph in 4 passes: 100% (3493608/3493608), done. Collecting commits from input: 3, done. Furthermore, that stop_progress() call was added after the 'cleanup' label, where that loop reading stdin jumps in case of an error. In case of invalid input this then results in the "done" line shown after the error message: $ { sleep 3 ; git rev-list -3 HEAD ; echo junk ; } | ~/src/git/git commit-graph write --stdin-commits error: unexpected non-hex object ID: junk Collecting commits from input: 3, done. Move that stop_progress() call to the right place. While at it, drop the unnecessary 'if (progress)' condition protecting the stop_progress() call, because that function is prepared to handle a NULL progress struct. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Reviewed-by: Derrick Stolee <stolee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-13git-diff.txt: reorder possible usagesMartin Ågren
The description of `git diff` goes through several different invocations (numbering added by me): 1. git diff [<options>] [--] [<path>...] 2. git diff [<options>] --no-index [--] <path> <path> 3. git diff [<options>] --cached [<commit>] [--] [<path>...] 4. git diff [<options>] <commit> [--] [<path>...] 5. git diff [<options>] <commit> <commit> [--] [<path>...] 6. git diff [<options>] <commit>..<commit> [--] [<path>...] 7. git diff [<options>] <commit> <commit>... <commit> [--] [<path>...] 8. git diff [<options>] <commit>...<commit> [--] [<path>...] It then goes on to say that "all of the <commit> in the above description, except in the last two forms that use '..' notations, can be any <tree>". The "last two" actually refers to 6 and 8. This got out of sync in commit b7e10b2ca2 ("Documentation: usage for diff combined commits", 2020-06-12) which added item 7 to the mix. As a further complication, after b7e10b2ca2 we also have some potential confusion around "the '..' notation". The "..[.]" in items 6 and 8 are part of the rev notation, whereas the "..." in item 7 is manpage language for "one or more". Move item 6 down, i.e., to between 7 and 8, to restore the ordering. Because 6 refers to 5 ("synonymous to the previous form") we need to tweak the language a bit. An added bonus of this commit is that we're trying to steer users away from `git diff <commit>..<commit>` and moving it further down probably doesn't hurt. Signed-off-by: Martin Ågren <martin.agren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-13git-diff.txt: don't mark required argument as optionalMartin Ågren
Commit b7e10b2ca2 ("Documentation: usage for diff combined commits", 2020-06-12) modified the synopsis by adding an optional "[<commit>...]" to 'git diff' [<options>] <commit> <commit> [--] [<path>...] to effectively add 'git diff' [<options>] <commit> <commit>... <commit> [--] [<path>...] as another valid invocation. Which makes sense. Further down, in the description, it left the existing entry for 'git diff' [<options>] <commit> <commit> [--] [<path>...] intact and added a new entry on 'git diff' [<options>] <commit> [<commit>...] <commit> [--] [<path>...] where it says that "[t]his form is to view the results of a merge commit" and details how "the first listed commit must be the merge itself". But one possible instantiation of this form is `git diff <commit> <commit>` for which the added text doesn't really apply. Remove the brackets so that we lose this overlap between the two descriptions. We can still use the more compact representation in the synopsis. Signed-off-by: Martin Ågren <martin.agren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-13Merge branch 'fr_v2.28.0_rnd1' of github.com:jnavila/gitJiang Xin
* 'fr_v2.28.0_rnd1' of github.com:jnavila/git: l10n: fr v2.28.0 round 1
2020-07-12l10n: fr v2.28.0 round 1Jean-Noël Avila
Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
2020-07-12Merge branch 'master' of github.com:nafmo/git-l10n-svJiang Xin
* 'master' of github.com:nafmo/git-l10n-sv: l10n: sv.po: Update Swedish translation (4931t0f0u)
2020-07-11l10n: sv.po: Update Swedish translation (4931t0f0u)Peter Krefting
Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
2020-07-11l10n: it.po: update the Italian translation for Git 2.28.0 round 1Alessandro Menti
Signed-off-by: Alessandro Menti <alessandro.menti@alessandromenti.it>
2020-07-10l10n: tr: v2.28.0 round 1Emir Sarı
Signed-off-by: Emir Sarı <bitigchi@me.com>
2020-07-10l10n: git.pot: v2.28.0 round 1 (70 new, 14 removed)Jiang Xin
Generate po/git.pot from v2.28.0-rc0 for git v2.28.0 l10n round 1. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2020-07-09Git 2.28-rc0v2.28.0-rc0Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-07-09Merge branch 'mt/entry-fstat-fallback-fix' into masterJunio C Hamano
"git checkout" failed to catch an error from fstat() after updating a path in the working tree. * mt/entry-fstat-fallback-fix: entry: check for fstat() errors after checkout
2020-07-09Merge branch 'ma/rebase-doc-typofix' into masterJunio C Hamano
Typofix. * ma/rebase-doc-typofix: git-rebase.txt: fix description list separator
2020-07-09Merge branch 'jn/eject-fetch-write-commit-graph-out-of-experimental' into masterJunio C Hamano
"fetch.writeCommitGraph" was enabled when "feature.experimental" is asked for, but it was found to be a bit too risky even for bold folks in its current shape. The configuration has been ejected, at least for now, from the "experimental" feature set. * jn/eject-fetch-write-commit-graph-out-of-experimental: experimental: default to fetch.writeCommitGraph=false
2020-07-09Merge branch 'tb/fix-persistent-shallow' into masterJunio C Hamano
When "fetch.writeCommitGraph" configuration is set in a shallow repository and a fetch moves the shallow boundary, we wrote out broken commit-graph files that do not match the reality, which has been corrected. * tb/fix-persistent-shallow: commit.c: don't persist substituted parents when unshallowing
2020-07-09Merge branch 'ct/diff-with-merge-base-clarification' into masterJunio C Hamano
Recent update to "git diff" meant as a code clean-up introduced a bug in its error handling code, which has been corrected. * ct/diff-with-merge-base-clarification: diff: check for merge bases before assigning sym->base