Commit Graph

47996 Commits

Author SHA1 Message Date
Martin Ågren
de121ffe57 tag: respect pager.tag in list-mode only
Using, e.g., `git -c pager.tag tag -a new-tag` results in errors such as
"Vim: Warning: Output is not to a terminal" and a garbled terminal.
Someone who makes use of both `git tag -a` and `git tag -l` will
probably not set `pager.tag`, so that `git tag -a` will actually work,
at the cost of not paging output of `git tag -l`.

Use the mechanisms introduced in two earlier patches to ignore
`pager.tag` in git.c and let the `git tag` builtin handle it on its own.
Only respect `pager.tag` when running in list-mode.

There is a window between where the pager is started before and after
this patch. This means that early errors can behave slightly different
before and after this patch. Since operation-parsing has to happen
inside this window, this can be seen with `git -c pager.tag="echo pager
is used" tag -l --unknown-option`. This change in paging-behavior should
be acceptable since it only affects erroneous usages.

Update the documentation and update tests.

If an alias is used to run `git tag -a`, then `pager.tag` will still be
respected. Document this known breakage. It will be fixed in a later
commit. Add a similar test for `-l`, which works.

Noticed-by: Anatoly Borodin <anatoly.borodin@gmail.com>
Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-03 11:08:10 -07:00
Martin Ågren
b3ee740c82 t7006: add tests for how git tag paginates
Using, e.g., `git -c pager.tag tag -a new-tag` results in errors such as
"Vim: Warning: Output is not to a terminal" and a garbled terminal.
Someone who makes use of both `git tag -a` and `git tag -l` will
probably not set `pager.tag`, so that `git tag -a` will actually work,
at the cost of not paging output of `git tag -l`.

Since we're about to change how `git tag` respects `pager.tag`, add tests
around this, including how the configuration is ignored if --no-pager or
--paginate are used.

Construct tests with a few different subcommands. First, use -l. Second,
use "no arguments" and --contains, since those imply -l. (There are
more arguments which imply -l, but using these two should be enough.)

Third, use -a as a representative for "not -l". Actually, the tests use
`git tag -am` so no editor is launched, but that is irrelevant, since we
just want to see whether the pager is used or not. Make one of the tests
demonstrate the broken behavior mentioned above, where `git tag -a`
respects `pager.tag`.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-03 11:08:10 -07:00
Martin Ågren
033fe3d92c git.c: provide setup_auto_pager()
The previous patch introduced a way for builtins to declare that they
will take responsibility for handling the `pager.foo`-config item. (See
the commit message of that patch for why that could be useful.)

Provide setup_auto_pager(), which builtins can call in order to handle
`pager.<cmd>`, including possibly starting the pager. Make this function
don't do anything if a pager has already been started, as indicated by
use_pager or pager_in_use().

Whenever this function is called from a builtin, git.c will already have
called commit_pager_choice(). Since commit_pager_choice() treats the
special value -1 as "punt" or "not yet decided", it is not a problem
that we might end up calling commit_pager_choice() once in git.c and
once (or more) in the builtin. Make the new function use -1 in the same
way and document it as "punt".

Don't add any users of setup_auto_pager just yet, one will follow in
a later patch.

Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-03 11:08:10 -07:00
Martin Ågren
c409824cc2 git.c: let builtins opt for handling pager.foo themselves
Before launching a builtin git foo and unless mechanisms with precedence
are in use, we check for and handle the `pager.foo` config. This is done
without considering exactly how git foo is being used, and indeed, git.c
cannot (and should not) know what the arguments to git foo are supposed
to achieve.

In practice this means that, e.g., `git -c pager.tag tag -a new-tag`
results in errors such as "Vim: Warning: Output is not to a terminal"
and a garbled terminal. Someone who makes use of both `git tag -a` and
`git tag -l` will probably not set `pager.tag`, so that `git tag -a`
will actually work, at the cost of not paging output of `git tag -l`.

To allow individual builtins to make more informed decisions about when
to respect `pager.foo`, introduce a flag DELAY_PAGER_CONFIG. If the flag
is set, do not check `pager.foo`.

Do not check for DELAY_PAGER_CONFIG in `execv_dashed_external()`. That
call site is arguably wrong, although in a way that is not yet visible,
and will be changed in a slightly different direction in a later patch.

Don't add any users of DELAY_PAGER_CONFIG just yet, one will follow in a
later patch.

Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-03 11:08:10 -07:00
Martin Ågren
ec14d4ecb5 builtin.h: take over documentation from api-builtin.txt
Delete Documentation/technical/api-builtin.txt and move its content
into builtin.h. Format it as a comment. Remove a '+' which was needed
when the information was formatted for AsciiDoc. Similarly, change
"::" to ":".

Document SUPPORT_SUPER_PREFIX, thereby bringing the documentation up to
date with the available flags.

While at it, correct '3 more things to do' to '4 more things to do'.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-03 11:08:10 -07:00
Junio C Hamano
384a8b271c l10n for Git 2.14.0 round 2
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJZgRf5AAoJEMek6Rt1RHooTBoQAI9sepb2JHPV0K/twKAFpMhj
 bXML7cE0Duf9J/30UUdAymEX5ao6NSfRtQz3qzP9l+JgrzKJ4C2QQ0mMo/8t3F3w
 hDyOaDmd3NvDl6QTqRFEY/OtLbDCXYt8K8XfzqPgIWmQIILxCjsESfL7M5yodscG
 qakFYjevvBtRsdXygwEhSGHZVgJcqJPUdW2mgEXpPayRXAceSpmhCKZB5GwMim37
 1cM96nudMI2AfwfDd9BMd1uyn7p5Hop2sEDIwqu/ZJPvtKMYJzBgAT0iQipLEBHw
 hbBQLIuyS8MXKtU7J6eMOs0c3gdYSVxK+dX6X/X7JRRdMr7FmHc1mHoI3iv0XsUD
 AAMpGO08Fcf9fTL2XYvffpzKXPdT2m1aPw77E728ssLqON2mIy5OjO0lGO3BlBOq
 VNWxE9Jj8FbyVpEuOH1lH2VxA8KU6p6EbpukqGqoRFGZVvwIJhWyINIOUk7aiLc3
 j7JBFhdQNJXTuqmuS1VKrkPqYd5cz95uYRWWt/OlFHIzQA7iWXsJQIwj9xCo1Weu
 H6c9ekGjguo6892hgF7tuQ8svQhUhH8X/dU2X/IM+KL+jfZZ4sr+lD+v3iuMTNOZ
 9YmL5M9SCadFUguHVFNOdWUwhW9TH/goDMBKd6Gq6hN8Y9RlJBem7kRwkc/OKh/L
 1VGVpjUHDSd/Sog20gcT
 =RMsi
 -----END PGP SIGNATURE-----

Merge tag 'l10n-2.14.0-rnd2' of git://github.com/git-l10n/git-po

l10n for Git 2.14.0 round 2

* tag 'l10n-2.14.0-rnd2' of git://github.com/git-l10n/git-po:
  l10n: zh_CN: review for git v2.14.0 l10n
  l10n: ko.po: Update Korean translation
  l10n: zh_CN: for git v2.14.0 l10n round 2
  l10n: de.po: various fixes in German translation
  l10n: ru.po: update Russian translation
  l10n: fr.po v2.14.0 rnd 2
  l10n: fr.po Fix some french typos
  l10n: fr.po Fix typo
  l10n: fr.po Fix some translations
  l10n: de.po: update German translation
  l10n: vi.po (3213t): Updated 9 new strings
  l10n: Update Catalan translation
  l10n: bg.po: Updated Bulgarian translation (3213t)
2017-08-02 10:52:33 -07:00
Jiang Xin
554e850170 l10n: zh_CN: review for git v2.14.0 l10n
Reviewed-by: 依云 <lilydjwg@gmail.com>
Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2017-08-02 08:02:37 +08:00
Junio C Hamano
c3eb4e6bfe Git 2.13.4
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCAAGBQJZgMxGAAoJELC16IaWr+bLaB8P/3hsI/ih6bddSgFGoYU6DrWm
 F7zKDa3qV0fS4bB3hEQPrkCWQTxoZdpvB3LLjChq8BUHxHfDSEs2SFmKJvS3NJxf
 YfFwxAc0vlLb84vX5j+3TiPbopZu1/P+HgZY27KiuDIUGgiCkXlJn6OzJm/wRjg0
 5/baGG7Qcy0lSWtWQDf09BRm+EliT6cCV0BlztfBFYW8Xp34+prhG9w0SPUXGJfZ
 jMKMLzoSdrg7fYW3YRjPRdppjU21/1FQOoJOiKLv9tRgsC0fon4XNgK+683eTofu
 KFiLklmxC4l70Kprlcr63zjOjd6CdfLO/fkqAqFBDMf1allbKSS0+kib6v87PeSC
 Nix+OQ/c/ko0bKs3dkvsN2nKM5cCT4Xce1PdSklClwHGLqzI42nCV9dBo5CCh42/
 IkqMgkpkLLeHJio1u8s6p39edmm1gJOD8XCPYG10avmRN7fsdgIB1JxL0dbIdq4L
 eC+h/zNDBP8rLaytbqIPWi1dCgtVJ9b+PojY33csfrjIAAu+gL8Rxwdyaqzned8+
 7Bp+UbxcVTStdNm6yIOSddZDn3nPiCNhkjXoE5JCZAqmQnzF8u2X6fwklvY97ybq
 bTTvaRg9/1WR2DeEPEbgtSNztGTrIEUFkjQTn1TF/4Lz+1Rx5tE7WlAJC7TGPnpE
 5pM9ux9TvJ/PRGWFuXvH
 =E6cV
 -----END PGP SIGNATURE-----

Sync with v2.13.4
2017-08-01 11:46:59 -07:00
Junio C Hamano
cf8899d285 Git 2.13.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-08-01 11:45:17 -07:00
Changwoo Ryu
3347e76939 l10n: ko.po: Update Korean translation
Signed-off-by: Changwoo Ryu <cwryu@debian.org>
2017-08-01 12:32:00 +09:00
Jiang Xin
a4f16749d2 l10n: zh_CN: for git v2.14.0 l10n round 2
Translate new l10n messages for git 2.14.0, and update translations on
"stash".

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2017-08-01 09:26:19 +08:00
Junio C Hamano
e2d9c46130 Sync with maint
* maint:
  Preparation for 2.13.4 continues
2017-07-31 13:52:53 -07:00
Junio C Hamano
c94ef19041 Preparation for 2.13.4 continues
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-07-31 13:52:40 -07:00
Junio C Hamano
0baf0b839b Merge branch 'ks/doc-fixes' into maint
Doc clean-up.

* ks/doc-fixes:
  doc: reformat the paragraph containing the 'cut-line'
  doc: camelCase the i18n config variables to improve readability
2017-07-31 13:51:06 -07:00
Junio C Hamano
42dbdef1ca Merge branch 'jk/test-copy-bytes-fix' into maint
A test fix.

* jk/test-copy-bytes-fix:
  t: handle EOF in test_copy_bytes()
2017-07-31 13:51:06 -07:00
Junio C Hamano
c6767f45e3 Merge branch 'pw/unquote-path-in-git-pm' into maint
Code refactoring.

* pw/unquote-path-in-git-pm:
  t9700: add tests for Git::unquote_path()
  Git::unquote_path(): throw an exception on bad path
  Git::unquote_path(): handle '\a'
  add -i: move unquote_path() to Git.pm
2017-07-31 13:51:05 -07:00
Junio C Hamano
133578a020 Merge branch 'jk/gc-pre-detach-under-hook' into maint
We run an early part of "git gc" that deals with refs before
daemonising (and not under lock) even when running a background
auto-gc, which caused multiple gc processes attempting to run the
early part at the same time.  This is now prevented by running the
early part also under the GC lock.

* jk/gc-pre-detach-under-hook:
  gc: run pre-detach operations under lock
2017-07-31 13:51:05 -07:00
Junio C Hamano
309ff914d5 Merge branch 'jn/hooks-pre-rebase-sample-fix' into maint
Code clean-up, that makes us in sync with Debian by one patch.

* jn/hooks-pre-rebase-sample-fix:
  pre-rebase hook: capture documentation in a <<here document
2017-07-31 13:51:05 -07:00
Junio C Hamano
4f77f618d9 Merge branch 'rs/progress-overall-throughput-at-the-end' into maint
The progress meter did not give a useful output when we haven't had
0.5 seconds to measure the throughput during the interval.  Instead
show the overall throughput rate at the end, which is a much more
useful number.

* rs/progress-overall-throughput-at-the-end:
  progress: show overall rate in last update
2017-07-31 13:51:04 -07:00
Junio C Hamano
49f1e2eb1b Merge branch 'tb/push-to-cygwin-unc-path' into maint
On Cygwin, similar to Windows, "git push //server/share/repository"
ought to mean a repository on a network share that can be accessed
locally, but this did not work correctly due to stripping the double
slashes at the beginning.

This may need to be heavily tested before it gets unleashed to the
wild, as the change is at a fairly low-level code and would affect
not just the code to decide if the push destination is local.  There
may be unexpected fallouts in the path normalization.

* tb/push-to-cygwin-unc-path:
  cygwin: allow pushing to UNC paths
2017-07-31 13:51:04 -07:00
Junio C Hamano
bc2c50fc2c Merge branch 'rs/apply-avoid-over-reading' into maint
Code cleanup.

* rs/apply-avoid-over-reading:
  apply: use strcmp(3) for comparing strings in gitdiff_verify_name()
  apply: use starts_with() in gitdiff_verify_name()
2017-07-31 13:51:04 -07:00
Junio C Hamano
483709ab4d Merge branch 'js/blame-lib'
A hotfix to a topic already in 'master'.

* js/blame-lib:
  blame: fix memory corruption scrambling revision name in error message
2017-07-31 13:05:15 -07:00
Hartmut Henkel
8d44797cc9 l10n: de.po: various fixes in German translation
Signed-off-by: Hartmut Henkel <henkel@vh-s.de>
Helped-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Acked-by: Matthias Rüster <matthias.ruester@gmail.com>
2017-07-30 17:21:06 +02:00
Jiang Xin
7873fb63f8 Merge branch 'russian-l10n' of https://github.com/DJm00n/git-po-ru
* 'russian-l10n' of https://github.com/DJm00n/git-po-ru:
  l10n: ru.po: update Russian translation
2017-07-30 22:47:47 +08:00
Dimitriy Ryazantcev
a65a75dfd6 l10n: ru.po: update Russian translation
Signed-off-by: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
2017-07-30 12:35:40 +03:00
Jiang Xin
79e8ee89ae Merge branch 'master' of https://github.com/ralfth/git-po-de
* 'master' of https://github.com/ralfth/git-po-de:
  l10n: de.po: update German translation
2017-07-27 23:12:11 +08:00
Jiang Xin
437d212413 Merge branch 'fr_l10n_v2.14.0rnd2' of git://github.com/jnavila/git
* 'fr_l10n_v2.14.0rnd2' of git://github.com/jnavila/git:
  l10n: fr.po v2.14.0 rnd 2
  l10n: fr.po Fix some french typos
  l10n: fr.po Fix typo
  l10n: fr.po Fix some translations
2017-07-27 23:10:13 +08:00
Jean-Noel Avila
12142e1bcb l10n: fr.po v2.14.0 rnd 2
Signed-off-by: Jean-Noel Avila <jean-noel.avila@scantech.fr>
2017-07-27 04:29:15 +02:00
Sylvestre Ledru
eb7bb1cc09 l10n: fr.po Fix some french typos
Signed-off-by: Sylvestre Ledru <sylvestre@debian.org>
2017-07-27 04:28:56 +02:00
Louis
694f610d65 l10n: fr.po Fix typo
Signed-off-by: Louis <spalax@gresille.org>
2017-07-27 04:22:23 +02:00
Hugues Peccatte
8430988d35 l10n: fr.po Fix some translations
Signed-off-by: Hugues Peccatte <hugues.peccatte@aareon.fr>
Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
2017-07-27 04:22:19 +02:00
Ralf Thielow
2166cd5af0 l10n: de.po: update German translation
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2017-07-26 18:22:27 +02:00
Jiang Xin
7b043d09b0 Merge branch 'master' of https://github.com/Softcatala/git-po
* 'master' of https://github.com/Softcatala/git-po:
  l10n: Update Catalan translation
2017-07-26 00:13:54 +08:00
Jiang Xin
b1bb0df04b Merge branch 'master' of git://github.com/alshopov/git-po
* 'master' of git://github.com/alshopov/git-po:
  l10n: bg.po: Updated Bulgarian translation (3213t)
2017-07-26 00:13:05 +08:00
Tran Ngoc Quan
365fb9d947 l10n: vi.po (3213t): Updated 9 new strings
Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
2017-07-25 07:09:13 +07:00
Junio C Hamano
5800c63717 Git 2.14-rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-07-24 14:50:35 -07:00
SZEDER Gábor
9e7d8a9bfb blame: fix memory corruption scrambling revision name in error message
When attempting to blame a non-existing path, git should show an error
message like this:

  $ git blame e83c51633 -- nonexisting-file
  fatal: no such path nonexisting-file in e83c51633

Since the recent commit 835c49f7d (blame: rework methods that
determine 'final' commit, 2017-05-24) the revision name is either
missing or some scrambled characters are shown instead.  The reason is
that the revision name must be duplicated, because it is invalidated
when the pending objects array is cleared in the meantime, but this
commit dropped the duplication.

Restore the duplication of the revision name in the affected functions
(find_single_final() and find_single_initial()).

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-07-24 14:38:02 -07:00
Junio C Hamano
9e3958e86d Merge https://github.com/git-l10n/git-po
* https://github.com/git-l10n/git-po:
  l10n: git.pot: v2.14.0 round 2 (9 new, 2 removed)
  l10n: sv.po: Update Swedish translation (3206t0f0u)
  l10n: ko.po: Update Korean translation
  l10n: Update Catalan translation
  l10n: bg.po: Updated Bulgarian translation (3206t)
  l10n: vi.po(3206t): Update Vietnamese translation
  l10n: git.pot: v2.14.0 round 1 (34 new, 23 removed)
  l10n: ru.po: update Russian translation
  l10n: Fixes to Catalan translation
2017-07-24 14:01:08 -07:00
Jordi Mas
1d99545f77 l10n: Update Catalan translation
Signed-off-by: Jordi Mas <jmas@softcatala.org>
2017-07-24 18:29:29 +02:00
Alexander Shopov
3db60c9132 l10n: bg.po: Updated Bulgarian translation (3213t)
Signed-off-by: Alexander Shopov <ash@kambanaria.org>
2017-07-24 17:28:43 +02:00
Jiang Xin
91d443d0d8 l10n: git.pot: v2.14.0 round 2 (9 new, 2 removed)
Generate po/git.pot from v2.14.0-rc0-40-g5eada8987e for git v2.14.0 l10n round 2.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2017-07-24 22:00:44 +08:00
Jiang Xin
92125538ff Merge branch 'master' of git://github.com/git-l10n/git-po
* 'master' of git://github.com/git-l10n/git-po:
  l10n: sv.po: Update Swedish translation (3206t0f0u)
  l10n: ko.po: Update Korean translation
  l10n: Update Catalan translation
  l10n: bg.po: Updated Bulgarian translation (3206t)
  l10n: vi.po(3206t): Update Vietnamese translation
  l10n: git.pot: v2.14.0 round 1 (34 new, 23 removed)
  l10n: ru.po: update Russian translation
  l10n: Fixes to Catalan translation
2017-07-24 21:53:47 +08:00
Jiang Xin
842e0d63aa Merge branch 'master' of git://github.com/nafmo/git-l10n-sv
* 'master' of git://github.com/nafmo/git-l10n-sv:
  l10n: sv.po: Update Swedish translation (3206t0f0u)
2017-07-22 06:19:21 +08:00
Junio C Hamano
5eada8987e Sync with maint
* maint:
  fixes from 'master' for 2.13.4
2017-07-21 15:13:25 -07:00
Junio C Hamano
2187e112d7 fixes from 'master' for 2.13.4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-07-21 15:06:09 -07:00
Junio C Hamano
38351249be Merge branch 'ew/fd-cloexec-fix' into maint
Portability/fallback fix.

* ew/fd-cloexec-fix:
  set FD_CLOEXEC properly when O_CLOEXEC is not supported
2017-07-21 15:03:40 -07:00
Junio C Hamano
bae7e3f153 Merge branch 'ks/fix-rebase-doc-picture' into maint
Doc update.

* ks/fix-rebase-doc-picture:
  doc: correct a mistake in an illustration
2017-07-21 15:03:39 -07:00
Junio C Hamano
bdea5bae22 Merge branch 'js/alias-case-sensitivity' into maint
A recent update broke an alias that contained an uppercase letter.

* js/alias-case-sensitivity:
  alias: compare alias name *case-insensitively*
  t1300: demonstrate that CamelCased aliases regressed
2017-07-21 15:03:38 -07:00
Junio C Hamano
ba1c08942c Merge branch 'bb/unicode-10.0' into maint
Update the character width tables.

* bb/unicode-10.0:
  unicode: update the width tables to Unicode 10
2017-07-21 15:03:38 -07:00
Junio C Hamano
19533e2c71 Hopefully the final last-minute fix before -rc1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-07-21 15:02:51 -07:00