Commit graph

40368 commits

Author SHA1 Message Date
Paul Tan bf72ac17d7 t4150: tests for am --[no-]scissors
Since 017678b (am/mailinfo: Disable scissors processing by default,
2009-08-26), git-am supported the --[no-]scissors option, passing it to
git-mailinfo.

Add tests to ensure that git-am will pass the --scissors option to
git-mailinfo, and that --no-scissors will override the configuration
setting of mailinfo.scissors.

Reviewed-by: Stefan Beller <sbeller@google.com>
Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-07-20 10:52:43 -07:00
Paul Tan 3ef4446bf2 t4150: am with post-applypatch hook
Since d1c5f2a (Add git-am, applymbox replacement., 2005-10-07),
git-am.sh will invoke the post-applypatch hook after the patch is
applied and a commit is made. The exit code of the hook is ignored.

Add tests for this hook.

Helped-by: Junio C Hamano <gitster@pobox.com>
Reviewed-by: Stefan Beller <sbeller@google.com>
Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-07-20 10:52:28 -07:00
Paul Tan 3bc6686b86 t4150: am with pre-applypatch hook
Since d1c5f2a (Add git-am, applymbox replacement., 2005-10-07),
git-am.sg will invoke the pre-applypatch hook after applying the patch
to the index, but before a commit is made. Should the hook exit with a
non-zero status, git am will exit.

Add tests for this hook.

Helped-by: Junio C Hamano <gitster@pobox.com>
Reviewed-by: Stefan Beller <sbeller@google.com>
Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-07-20 10:52:21 -07:00
Paul Tan f26bdf2d98 t4150: am with applypatch-msg hook
Since d1c5f2a (Add git-am, applymbox replacement., 2005-10-07), git-am
will invoke the applypatch-msg hooks just after extracting the patch
message. If the applypatch-msg hook exits with a non-zero status, git-am
abort before even applying the patch to the index.

Add tests for this hook.

Helped-by: Junio C Hamano <gitster@pobox.com>
Reviewed-by: Stefan Beller <sbeller@google.com>
Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-07-20 10:52:13 -07:00
Paul Tan 9e2a113db9 t4150: am --resolved fails if index has unmerged entries
Since c1d1128 (git-am --resolved: more usable error message.,
2006-04-28), git-am --resolved will check to see if there are any
unmerged entries, and will error out with a user-friendly error message
if there are.

Add a test for this.

Reviewed-by: Stefan Beller <sbeller@google.com>
Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-07-20 10:52:04 -07:00
Paul Tan 60ff7f9f5c t4150: am --resolved fails if index has no changes
Since 6d28644 (git-am: do not allow empty commits by mistake.,
2006-02-23), git-am --resolved will check to see if the index has any
changes to prevent the user from creating an empty commit by mistake.

Add a test for this.

Reviewed-by: Stefan Beller <sbeller@google.com>
Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-07-20 10:51:47 -07:00
Paul Tan b4967ab490 t4150: am refuses patches when paused
Since c95b138 (Fix git-am safety checks, 2006-09-15), when there is a
session in progress, git-am will check the command-line arguments and
standard input to ensure that the user does not pass it any patches.

Add a test for this.

Reviewed-by: Stefan Beller <sbeller@google.com>
Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-07-20 10:51:37 -07:00
Paul Tan 528484c645 t4151: am --abort will keep dirty index intact
Since 7b3b7e3 (am --abort: keep unrelated commits since the last failure
and warn, 2010-12-21), git-am --abort will not touch the index if on the
previous invocation, git-am failed because the index is dirty. This is
to ensure that the user's modifications to the index are not discarded.

Add a test for this.

Reviewed-by: Stefan Beller <sbeller@google.com>
Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-07-20 10:51:18 -07:00
Paul Tan ab156128fa t4150: am fails if index is dirty
Since d1c5f2a (Add git-am, applymbox replacement., 2005-10-07), git-am
will ensure that the index is clean before applying the patch. This is
to prevent changes unrelated to the patch from being committed.

Add a test for this check.

Reviewed-by: Stefan Beller <sbeller@google.com>
Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Paul Tan <pyokagan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-07-20 10:51:02 -07:00
Charles Bailey 100e433741 untracked: fix detection of uname(2) failure
According to POSIX specification uname(2) must return -1 on failure
and a non-negative value on success.  Although many implementations
do return 0 on success it is valid to return any positive value for
success.  In particular, Solaris returns 1.

Signed-off-by: Charles Bailey <cbailey32@bloomberg.net>
Reviewed-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-07-17 14:39:59 -07:00
Junio C Hamano fbdeabf1f0 Merge branch 'jk/still-interesting'
Code clean-up.

* jk/still-interesting:
  revision.c: remove unneeded check for NULL
2015-07-17 10:44:56 -07:00
Junio C Hamano 4d9f744e34 Merge branch 'es/worktree-add'
Update to the "linked checkout" in 2.5.0-rc1.

Instead of "checkout --to" that does not do what "checkout"
normally does, move the functionality to "git worktree add".

As this makes the end-user experience of the "worktree add" more or
less complete, I am tempted to say we should cook the other topic
that removes the internal "new-worktree-mode" hack from "checkout"
a bit longer in 'next', and release 2.5 final without that one.

* es/worktree-add:
  Documentation/git: fix stale "MULTIPLE CHECKOUT MODE" reference
  worktree: caution that this is still experimental
  Documentation/git-worktree: fix stale "git checkout --to" references
2015-07-17 10:44:55 -07:00
Eric Sunshine 1eaca7a5bb Documentation/git: fix stale "MULTIPLE CHECKOUT MODE" reference
This should have been changed by 93a3649 (Documentation: move linked
worktree description from checkout to worktree, 2015-07-06).

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-07-17 10:05:36 -07:00
Junio C Hamano 18b22dbed8 worktree: caution that this is still experimental
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-07-16 15:59:48 -07:00
Eric Sunshine 4d5a3c5884 Documentation/git-worktree: fix stale "git checkout --to" references
These should have been changed to "git worktree add" by fc56361
(worktree: introduce "add" command, 2015-07-06.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-07-16 15:59:17 -07:00
Jiang Xin 01d597feec Merge branch 'master' of https://github.com/ralfth/git-po-de
* 'master' of https://github.com/ralfth/git-po-de:
  l10n: de.po: translate 9 new messages
2015-07-16 07:44:43 +08:00
Junio C Hamano 6003e7f93a Sync with 2.4.6 2015-07-15 12:32:37 -07:00
Junio C Hamano bb3e7b1a55 Git 2.4.6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-07-15 12:31:07 -07:00
Junio C Hamano abecddea25 Merge branch 'jc/diff-ws-error-highlight'
A hotfix to a new feature in 2.5.0-rc.

* jc/diff-ws-error-highlight:
  diff: parse ws-error-highlight option more strictly
2015-07-15 12:30:14 -07:00
Junio C Hamano b7abfacf5e Merge branch 'mm/describe-doc' into maint
Docfix.

* mm/describe-doc:
  Documentation/describe: improve one-line summary
2015-07-15 11:41:26 -07:00
Junio C Hamano 51d5980ea0 Merge branch 'jc/prompt-document-ps1-state-separator' into maint
Docfix.

* jc/prompt-document-ps1-state-separator:
  git-prompt.sh: document GIT_PS1_STATESEPARATOR
2015-07-15 11:41:26 -07:00
Junio C Hamano 3f20927717 Merge branch 'es/osx-header-pollutes-mask-macro' into maint
* es/osx-header-pollutes-mask-macro:
  ewah: use less generic macro name
  ewah/bitmap: silence warning about MASK macro redefinition
2015-07-15 11:41:24 -07:00
Junio C Hamano 71a8af60ae Merge branch 'es/utf8-stupid-compiler-workaround' into maint
A compilation workaround.

* es/utf8-stupid-compiler-workaround:
  utf8: NO_ICONV: silence uninitialized variable warning
2015-07-15 11:41:23 -07:00
Junio C Hamano a15ebbc2c7 Merge branch 'fk/doc-format-patch-vn' into maint
Docfix.

* fk/doc-format-patch-vn:
  doc: format-patch: fix typo
2015-07-15 11:41:22 -07:00
Junio C Hamano e9da4e6ff2 Merge branch 'pt/t0302-needs-sanity' into maint
* pt/t0302-needs-sanity:
  t0302: "unreadable" test needs SANITY prereq
2015-07-15 11:41:21 -07:00
Junio C Hamano eca143b721 Merge branch 'me/fetch-into-shallow-safety' into maint
"git fetch --depth=<depth>" and "git clone --depth=<depth>" issued
a shallow transfer request even to an upload-pack that does not
support the capability.

* me/fetch-into-shallow-safety:
  fetch-pack: check for shallow if depth given
2015-07-15 11:41:20 -07:00
Junio C Hamano 697f67ac9f Merge branch 'mh/fsck-reflog-entries' into maint
"git fsck" used to ignore missing or invalid objects recorded in reflog.

* mh/fsck-reflog-entries:
  fsck: report errors if reflog entries point at invalid objects
  fsck_handle_reflog_sha1(): new function
2015-07-15 11:41:19 -07:00
Junio C Hamano ada9ecd989 Merge branch 'af/tcsh-completion-noclobber' into maint
The tcsh completion writes a bash scriptlet but that would have
failed for users with noclobber set.

* af/tcsh-completion-noclobber:
  git-completion.tcsh: fix redirect with noclobber
2015-07-15 11:41:18 -07:00
Junio C Hamano 7c621186ba Merge branch 'pa/auto-gc-mac-osx' into maint
Recent Mac OS X updates breaks the logic to detect that the machine
is on the AC power in the sample pre-auto-gc script.

* pa/auto-gc-mac-osx:
  hooks/pre-auto-gc: adjust power checking for newer OS X
2015-07-15 11:41:17 -07:00
Junio C Hamano 93eba05b4f Merge branch 'jc/do-not-feed-tags-to-clear-commit-marks' into maint
"git format-patch --ignore-if-upstream A..B" did not like to be fed
tags as boundary commits.

* jc/do-not-feed-tags-to-clear-commit-marks:
  format-patch: do not feed tags to clear_commit_marks()
2015-07-15 11:41:16 -07:00
Ralf Thielow f1e80c0829 l10n: de.po: translate 9 new messages
Translate 9 new messages came from git.pot update in a4156d2
(l10n: git.pot: v2.5.0 round 2 (9 new, 5 removed)).

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Acked-by: Phillip Sz <phillip.szelat@gmail.com>
2015-07-15 20:30:52 +02:00
Alexander Shopov 619b8f8636 l10n: Updated Bulgarian translation of git (2359t,0f,0u)
Signed-off-by: Alexander Shopov <ash@kambanaria.org>
2015-07-15 20:34:23 +03:00
Ilya Bobyr 2d893dff4c rev-parse --parseopt: allow [*=?!] in argument hints
A line in the input to "rev-parse --parseopt" describes an option by
listing a short and/or long name, optional flags [*=?!], argument hint,
and then whitespace and help string.

We did not allow any of the [*=?!] characters in the argument hints.
The following input

    pair=key=value  equals sign in the hint

used to generate a help line like this:

    --pair=key <value>   equals sign in the hint

and used to expect "pair=key" as the argument name.

That is not very helpful as we generally do not want any of the [*=?!]
characters in the argument names.  But we do want to use at least the
equals sign in the argument hints.

Update the parser to make long argument names stop at the first [*=?!]
character.

Add test case with equals sign in the argument hint and update the test
to perform all the operations in test_expect_success matching the
t/README requirements and allowing commands like

    ./t1502-rev-parse-parseopt.sh --run=1-2

to stop at the test case 2 without any further modification of the test
state area.

Signed-off-by: Ilya Bobyr <ilya.bobyr@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-07-15 10:30:54 -07:00
Jiang Xin 5bb01d4f02 l10n: zh_CN: for git v2.5.0 l10n round 2
Update 9 translations (2359t0f0u) for git v2.5.0-rc2.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2015-07-15 23:21:08 +08:00
Peter Krefting e557179a63 l10n: sv.po: Update Swedish translation (2359t0f0u)
Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
2015-07-15 12:54:11 +01:00
Jiang Xin 297230d490 Merge branch 'fr_v2.5.0-round2' of git://github.com/jnavila/git
* 'fr_v2.5.0-round2' of git://github.com/jnavila/git:
  l10n: fr v2.5.0 round 2 (2359t)
2015-07-15 07:06:49 +08:00
Jean-Noel Avila be67fb4fc9 l10n: fr v2.5.0 round 2 (2359t)
Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
2015-07-14 23:03:24 +02:00
Jiang Xin 9ce8613349 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
2015-07-14 22:30:12 +08:00
Dimitriy Ryazantcev a3e55f72ba l10n: ru.po: update Russian translation
Signed-off-by: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
2015-07-14 16:34:00 +03:00
Tran Ngoc Quan 21f637378d l10n: Updated Vietnamese translation (2359t)
Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
2015-07-14 07:30:51 +07:00
Jiang Xin a4156d2034 l10n: git.pot: v2.5.0 round 2 (9 new, 5 removed)
Generate po/git.pot from v2.5.0-rc2 for git v2.5.0 l10n round 2.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2015-07-14 07:20:08 +08:00
Junio C Hamano 961abca02c l10n-2.5.0-rnd1
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJVou6CAAoJEMek6Rt1RHooPBYQAIY+rhIZdp9Wr/mkRU6qPAc1
 lI3nb1ebGSjgXMTxU58weNIHb4EAd3/k61nngj5Kyi95BwAqJmLpWyJaO0MXlb5Y
 pQrHjB78cTRH1Y7NVR2DzYX4TXsizXxUY+821Au+jjYxGNeh8XMeVR0UZnORB5vg
 493h/Wl+Ox89JTarhPd+x6TjA6miAePnTlWpU47zNFmoctGtDZGiqzQTOgTnp4N1
 GaTFGZLXhPbymXp6UnUXziQGGEvSF53DhncpIeAAaTvMotusJd5xWvQmGQD6csn7
 g75ByCG0tUWA+iaIpRRThOOsbAyf5OCg5ElgpSvogr6PVxJEijRt7bSJsOnARduK
 M60gyHGWka2rrarkDChlx8cY2N83PNrQOkmEKkpPkyu8odNvSJxRHfixKyNsEh98
 aiJkH1s1AuUVU5Shj2IYWy4rCkLNbugGCKCB2h6bhpiOMrfBNYjQ1hF6UqNRdieF
 cr4qhr5aTZN3SfR7aX2mZ0l4i0N1/XLPW5ZyKGk2XPxfTJNFKo+NhtKHudX8IT85
 VKZZC7fJmgq0loVgQy2JGlAd4iM/zLwD8DAh9hGYxe5lplBOON3akRaBDnJY4MZl
 7X5RcEo9J6av1ZJOLoyLaCMTjFTz3oGeYWgegnaZsNO7fAaRQ03li1FBnR8dM+xW
 smubiD7StXWxGOzBu24V
 =EWoG
 -----END PGP SIGNATURE-----

Merge tag 'l10n-2.5.0-rnd1' of git://github.com/git-l10n/git-po

l10n-2.5.0-rnd1

* tag 'l10n-2.5.0-rnd1' of git://github.com/git-l10n/git-po:
  l10n: de.po: translate 65 new messages
  l10n: de.po: translate "index" as "Index"
  l10n: de.po: fix translation of "head nodes"
  l10n: zh_CN: for git v2.5.0 l10n round 1
  l10n: ca.po: update translation
  l10n: fr.po v2.5.0-rc0 (2355t)
  l10n: Updated Bulgarian translation of git (2355t,0f,0u)
  l10n: sv.po: Update Swedish translation (2355t0f0u)
  l10n: Updated Vietnamese translation (2355t)
  l10n: git.pot: v2.5.0 round 1 (65 new, 15 removed)
2015-07-13 15:37:24 -07:00
Junio C Hamano 01977f46cb Git 2.5.0-rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-07-13 14:04:30 -07:00
Junio C Hamano 799767cc98 Merge branch 'es/worktree-add'
Update to the "linked checkout" in 2.5.0-rc1.

Instead of "checkout --to" that does not do what "checkout"
normally does, move the functionality to "git worktree add".

* es/worktree-add: (24 commits)
  Revert "checkout: retire --ignore-other-worktrees in favor of --force"
  checkout: retire --ignore-other-worktrees in favor of --force
  worktree: add: auto-vivify new branch when <branch> is omitted
  worktree: add: make -b/-B default to HEAD when <branch> is omitted
  worktree: extract basename computation to new function
  checkout: require worktree unconditionally
  checkout: retire --to option
  tests: worktree: retrofit "checkout --to" tests for "worktree add"
  worktree: add -b/-B options
  worktree: add --detach option
  worktree: add --force option
  worktree: introduce "add" command
  checkout: drop 'checkout_opts' dependency from prepare_linked_checkout
  checkout: make --to unconditionally verbose
  checkout: prepare_linked_checkout: drop now-unused 'new' argument
  checkout: relocate --to's "no branch specified" check
  checkout: fix bug with --to and relative HEAD
  Documentation/git-worktree: add EXAMPLES section
  Documentation/git-worktree: add high-level 'lock' overview
  Documentation/git-worktree: split technical info from general description
  ...
2015-07-13 14:02:19 -07:00
Junio C Hamano 7783eb2e59 Merge branch 'nd/multiple-work-trees'
"git checkout [<tree-ish>] <paths>" spent unnecessary cycles
checking if the current branch was checked out elsewhere, when we
know we are not switching the branches ourselves.

* nd/multiple-work-trees:
  worktree: new place for "git prune --worktrees"
  checkout: don't check worktrees when not necessary
2015-07-13 14:02:02 -07:00
Junio C Hamano 721f5bb896 Merge branch 'ss/clone-guess-dir-name-simplify'
Code simplification.

* ss/clone-guess-dir-name-simplify:
  clone: simplify string handling in guess_dir_name()
2015-07-13 14:00:28 -07:00
Junio C Hamano 313f52334b Merge branch 'kb/config-unmap-before-renaming'
"git config" failed to update the configuration file when the
underlying filesystem is incapable of renaming a file that is still
open.

* kb/config-unmap-before-renaming:
  config.c: fix writing config files on Windows network shares
2015-07-13 14:00:27 -07:00
Junio C Hamano d790ba92cc Merge branch 'mh/strbuf-read-file-returns-ssize-t'
Avoid possible ssize_t to int truncation.

* mh/strbuf-read-file-returns-ssize-t:
  strbuf: strbuf_read_file() should return ssize_t
2015-07-13 14:00:27 -07:00
Junio C Hamano 6cf7eef384 Merge branch 'jc/unexport-git-pager-in-use-in-pager'
When you say "!<ENTER>" while running say "git log", you'd confuse
yourself in the resulting shell, that may look as if you took
control back to the original shell you spawned "git log" from but
that isn't what is happening.  To that new shell, we leaked
GIT_PAGER_IN_USE environment variable that was meant as a local
communication between the original "Git" and subprocesses that was
spawned by it after we launched the pager, which caused many
"interesting" things to happen, e.g. "git diff | cat" still paints
its output in color by default.

Stop leaking that environment variable to the pager's half of the
fork; we only need it on "Git" side when we spawn the pager.

* jc/unexport-git-pager-in-use-in-pager:
  pager: do not leak "GIT_PAGER_IN_USE" to the pager
2015-07-13 14:00:27 -07:00
Junio C Hamano 43f23b09bf Merge branch 'kb/use-nsec-doc'
Clarify in the Makefile a guideline to decide use of USE_NSEC.

* kb/use-nsec-doc:
  Makefile / racy-git.txt: clarify USE_NSEC prerequisites
2015-07-13 14:00:26 -07:00