Commit graph

41376 commits

Author SHA1 Message Date
Junio C Hamano 51a0908a6f Merge branch 'pt/am-builtin'
When "git am" was rewritten as a built-in, it stopped paying
attention to user.signingkey, which was fixed.

* pt/am-builtin:
  am: configure gpg at startup
2015-10-15 15:43:40 -07:00
Junio C Hamano b9d23c2110 Merge branch 'nd/clone-linked-checkout'
It was not possible to use a repository-lookalike created by "git
worktree add" as a local source of "git clone".

* nd/clone-linked-checkout:
  clone: better error when --reference is a linked checkout
  clone: allow --local from a linked checkout
  enter_repo: allow .git files in strict mode
  enter_repo: avoid duplicating logic, use is_git_directory() instead
  t0002: add test for enter_repo(), non-strict mode
  path.c: delete an extra space
2015-10-15 15:43:40 -07:00
Junio C Hamano 6652939ce8 Merge branch 'js/icase-wt-detection'
On a case insensitive filesystems, setting GIT_WORK_TREE variable
using a random cases that does not agree with what the filesystem
thinks confused Git that it wasn't inside the working tree.

* js/icase-wt-detection:
  setup: fix "inside work tree" detection on case-insensitive filesystems
2015-10-15 15:43:39 -07:00
Junio C Hamano 7f11b48521 Merge branch 'kn/for-each-branch'
Update "git branch" that list existing branches, using the
ref-filter API that is shared with "git tag" and "git
for-each-ref".

* kn/for-each-branch:
  branch: add '--points-at' option
  branch.c: use 'ref-filter' APIs
  branch.c: use 'ref-filter' data structures
  branch: drop non-commit error reporting
  branch: move 'current' check down to the presentation layer
  branch: roll show_detached HEAD into regular ref_list
  branch: bump get_head_description() to the top
  branch: refactor width computation
2015-10-15 15:43:38 -07:00
Junio C Hamano d5ef5f522a Merge branch 'sb/perf-without-installed-git'
Performance-measurement tests did not work without an installed Git.

* sb/perf-without-installed-git:
  t/perf: make runner work even if Git is not installed
2015-10-15 15:43:37 -07:00
Junio C Hamano c92df72bf4 Merge branch 'sb/http-flaky-test-fix'
A test script for the HTTP service had a timing dependent bug,
which was fixed.

* sb/http-flaky-test-fix:
  t5561: get rid of racy appending to logfile
2015-10-15 15:43:36 -07:00
Junio C Hamano 30ce3b3bbc Merge branch 'jc/fsck-dropped-errors'
There were some classes of errors that "git fsck" diagnosed to its
standard error that did not cause it to exit with non-zero status.

* jc/fsck-dropped-errors:
  fsck: exit with non-zero when problems are found
2015-10-15 15:43:35 -07:00
Junio C Hamano 00272a6339 Merge branch 'ls/p4-translation-failure'
Work around "git p4" failing when the P4 depot records the contents
in UTF-16 without UTF-16 BOM.

* ls/p4-translation-failure:
  git-p4: handle "Translation of file content failed"
  git-p4: add test case for "Translation of file content failed" error
2015-10-15 15:43:34 -07:00
Junio C Hamano 076c827858 Merge branch 'nd/gc-auto-background-fix'
When "git gc --auto" is backgrounded, its diagnosis message is
lost.  Save it to a file in $GIT_DIR and show it next time the "gc
--auto" is run.

* nd/gc-auto-background-fix:
  gc: save log from daemonized gc --auto and print it next time
2015-10-15 15:43:33 -07:00
Junio C Hamano 1c630badac Merge branch 'mk/submodule-gitdir-path'
The submodule code has been taught to work better with separate
work trees created via "git worktree add".

* mk/submodule-gitdir-path:
  path: implement common_dir handling in git_pathdup_submodule()
  submodule refactor: use strbuf_git_path_submodule() in add_submodule_odb()
2015-10-15 15:43:32 -07:00
Junio C Hamano b27dacc1a8 Third batch for 2.7
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-14 14:31:23 -07:00
Junio C Hamano 1311587d96 Merge branch 'pt/pull-builtin'
* pt/pull-builtin:
  merge: grammofix in please-commit-before-merge message
2015-10-14 14:30:21 -07:00
Junio C Hamano c35acb632c Merge branch 'nd/ls-remote-does-not-have-u-option'
* nd/ls-remote-does-not-have-u-option:
  ls-remote.txt: delete unsupported option
2015-10-14 14:30:19 -07:00
Junio C Hamano 8e2b4b2942 Merge branch 'jk/asciidoctor-section-heading-markup-fix'
* jk/asciidoctor-section-heading-markup-fix:
  Documentation: fix section header mark-up
2015-10-14 14:30:18 -07:00
Junio C Hamano d10a7f7535 Merge branch 'tk/typofix-connect-unknown-proto-error'
* tk/typofix-connect-unknown-proto-error:
  connect: fix typo in result string of prot_name()
2015-10-14 14:30:17 -07:00
Junio C Hamano 262cffe6c9 Merge branch 'jk/notes-dwim-doc'
The way how --ref/--notes to specify the notes tree reference are
DWIMmed was not clearly documented.

* jk/notes-dwim-doc:
  notes: correct documentation of DWIMery for notes references
2015-10-14 14:30:15 -07:00
Junio C Hamano fae1a901ec Documentation/gc: warn against --prune=<now>
"git gc" is safe to run anytime only because it has the built-in
grace period to protect objects that are created by other processes
that are waiting for ref updates to anchor them to the history.  In
order to run with no grace period, the user must make sure that the
repository is quiescent.

Reviewed-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-14 13:48:39 -07:00
Torsten Bögershausen 710b4e8a16 t0027: improve test for not-normalized files
When a text file with mixed line endings is commited into the repo,
it is called "not normalized" (or NNO) in t0027.  The existing test
case using repoMIX did not fully test all combinations: (Especially
when core.autocrlf = true) Files with NL are not converted at
commit, but at checkout, so a warning NL->CRLF is given.  Files with
CRLF are not converted at all (so no warning will be given), unless
they are marked as "text" or "auto".

Remove repoMIX introduced in commit 8eeab92f02, and replace it with
a combination of NNO tests.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
2015-10-12 15:07:45 -07:00
Stefan Beller 147875fd25 submodule-config: "goto" removal in parse_config()
Many components in if/else if/... cascade jumped to a shared
clean-up with "goto release_return", but we can restructure the
function a bit and make them disappear, which reduces the line count
as well.  Also reformat overlong lines and poorly indented ones
while at it.

The order of rules to verify the value for "ignore" used to be to
complain on multiple values first and then complain to boolean, but
swap the order to match how the values for "path" and "url" are
verified.

CC: Eric Sunshine <sunshine@sunshineco.com>
CC: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-12 12:28:33 -07:00
James McCoy a5a4b3ff4d filter-branch: remove multi-line headers in msg filter
df062010 (filter-branch: avoid passing commit message through sed)
introduced a regression when filtering commits with multi-line headers,
if the header contains a blank line.  An example of this is a gpg-signed
commit:

  $ git cat-file commit signed-commit
  tree 3d4038e029712da9fc59a72afbfcc90418451630
  parent 110eac945dc1713b27bdf49e74e5805db66971f0
  author A U Thor <author@example.com> 1112912413 -0700
  committer C O Mitter <committer@example.com> 1112912413 -0700
  gpgsig -----BEGIN PGP SIGNATURE-----
   Version: GnuPG v1

   iEYEABECAAYFAlYXADwACgkQE7b1Hs3eQw23CACgldB/InRyDgQwyiFyMMm3zFpj
   pUsAnA+f3aMUsd9mNroloSmlOgL6jIMO
   =0Hgm
   -----END PGP SIGNATURE-----

  Adding gpg

As a consequence, "filter-branch --msg-filter cat" (which should leave the
commit message unchanged) spills the signature (after the internal blank
line) into the original commit message.

The reason is that although the signature is indented, making the line a
whitespace only line, the "read" call is splitting the line based on
the shell's IFS, which defaults to <space><tab><newline>.  The leading
space is consumed and $header_line is empty, causing the "skip header
lines" loop to exit.

The rest of the commit object is then re-used as the rewritten commit
message, causing the new message to include the signature of the
original commit.

Set IFS to an empty string for the "read" call, thus disabling the word
splitting, which causes $header_line to be set to the non-empty value ' '.
This allows the loop to fully consume the header lines before
emitting the original, intact commit message.

[jc: this is literally based on MJG's suggestion]

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: James McCoy <vega.james@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-12 11:23:19 -07:00
Matthieu Moy 4b1fd356b8 git-multimail: update to release 1.2.0
The changes are described in CHANGES.

Contributions-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Contributions-by: Elijah Newren <newren@palantir.com>
Contributions-by: Edward d'Auvergne <edward@nmr-relax.com>
Contributions-by: Vadim Zeitlin <vadim@zeitlins.org>
Contributions-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Contributions-by: Michael Haggerty <mhagger@alum.mit.edu>
Contributions-by: Elijah Newren <newren@gmail.com>
Contributions-by: Richard Hansen <rhansen@rhansen.org>
Contributions-by: Job Snijders <job@instituut.net>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-12 10:38:33 -07:00
Lars Schneider eb8e364969 git-p4: skip t9819 test case on case insensitive file systems
Windows and OS X file systems are case insensitive by default.
Consequently the "git-p4-case-folding" test case does not apply to
them.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-12 10:36:54 -07:00
Lars Schneider 3a692b3c87 git-p4: avoid "stat" command in t9815 git-p4-submit-fail
Replace the stat command with the ls command to check file mode
bits.  The stats command is not available on Windows and has
different command line options on OS X.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-12 10:36:16 -07:00
Junio C Hamano c63d4b2fe8 am -3: do not let failed merge from completing the error codepath
When "am" was rewritten in C, the codepath for falling back to
three-way merge was mistakenly made to make an internal call to
merge-recursive, disabling the error reporting code for certain
types of errors merge-recursive detects and reports by calling
die().

This is a quick-fix for correctness.  The ideal endgame would be to
replace run_command() in run_fallback_merge_recursive() with a
direct call after making sure that internal call to merge-recursive
does not die().

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-09 13:38:30 -07:00
Ray Donnelly b2a7123b99 test-path-utils.c: remove incorrect assumption
In normalize_ceiling_entry(), we test that normalized paths end with
slash, *unless* the path to be normalized was already the root
directory.

However, normalize_path_copy() does not even enforce this condition.

Even worse: on Windows, the root directory gets translated into a
Windows directory by the Bash before being passed to `git.exe` (or
`test-path-utils.exe`), which means that we cannot even know whether
the path that was passed to us was the root directory to begin with.

This issue has already caused endless hours of trying to "fix" the
MSYS2 runtime, only to break other things due to MSYS2 ensuring that
the converted path maintains the same state as the input path with
respect to any final '/'.

So let's just forget about this test. It is non-essential to Git's
operation, anyway.

Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Ray Donnelly <mingw.android@gmail.com>
2015-10-08 18:03:50 -07:00
Johannes Schindelin 14886b40c5 pack-objects: do not get distracted by broken symrefs
It is quite possible for, say, a remote HEAD to become broken, e.g.
when the default branch was renamed.

We should still be able to pack our objects when such a thing happens;
simply ignore broken symrefs (because they cannot matter for the packing
process anyway).

This fixes https://github.com/git-for-windows/git/issues/423

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-08 12:42:06 -07:00
Michael Rappazzo bb9c03b82a worktree: add 'list' command
'git worktree list' iterates through the worktree list, and outputs
details of the worktree including the path to the worktree, the currently
checked out revision and branch, and if the work tree is bare.  There is
also porcelain format option available.

Signed-off-by: Michael Rappazzo <rappazzo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-08 11:57:14 -07:00
Michael Rappazzo 92718b7438 worktree: add details to the worktree struct
In addition to the absolute path in the worktree struct, add the location
of the git dir, the head ref (if not detached), the head revision sha1,
whether or not head is detached, and whether or not the worktree is a
bare repo.

Signed-off-by: Michael Rappazzo <rappazzo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-08 11:57:07 -07:00
Michael Rappazzo 5193490442 worktree: add a function to get worktree details
The worktree structure provided for an individual worktree includes the
absolute path of the worktree.  The fuction to get the worktree details
is a refactor of the find main/linked symref functions.

Signed-off-by: Michael Rappazzo <rappazzo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-08 11:56:25 -07:00
Michael Rappazzo 1ceb7f9067 worktree: refactor find_linked_symref function
Refactoring will help transition this code to provide additional useful
worktree functions.

Signed-off-by: Michael Rappazzo <rappazzo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-08 11:56:05 -07:00
Christian Couder 44cd91eab2 quote: move comment before sq_quote_buf()
A big comment at the beginning of quote.c is really
related to sq_quote_buf(), so let's move it in front
of this function.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-07 15:12:01 -07:00
Christian Couder ca9da0d810 quote: fix broken sq_quote_buf() related comment
Since 77d604c (Enhanced sq_quote(), 10 Oct 2005), the
comment at the beginning of quote.c is broken.
Let's fix it.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-07 15:11:54 -07:00
Junio C Hamano f5b6079871 Second batch for 2.7
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-07 13:38:43 -07:00
Junio C Hamano 98f9556a44 Merge branch 'ls/p4-path-encoding'
"git p4" learned to reencode the pathname it uses to communicate
with the p4 depot with a new option.

* ls/p4-path-encoding:
  git-p4: use replacement character for non UTF-8 characters in paths
  git-p4: improve path encoding verbose output
  git-p4: add config git-p4.pathEncoding
2015-10-07 13:38:19 -07:00
Junio C Hamano a23d263b69 Merge branch 'gb/filter-branch-progress'
Give progress meter to "git filter-branch".

* gb/filter-branch-progress:
  filter-branch: make report-progress more readable
  filter-branch: add passed/remaining seconds on progress
2015-10-07 13:38:18 -07:00
Junio C Hamano 506d8f1b39 Merge branch 'nd/ignore-then-not-ignore'
Allow a later "!/abc/def" to override an earlier "/abc" that
appears in the same .gitignore file to make it easier to express
"everything in /abc directory is ignored, except for ...".

* nd/ignore-then-not-ignore:
  dir.c: don't exclude whole dir prematurely if neg pattern may match
  dir.c: make last_exclude_matching_from_list() run til the end
2015-10-07 13:38:17 -07:00
Junio C Hamano 2b72dbbcf3 Merge branch 'ti/glibc-stdio-mutex-from-signal-handler'
Allocation related functions and stdio are unsafe things to call
inside a signal handler, and indeed killing the pager can cause
glibc to deadlock waiting on allocation mutex as our signal handler
tries to free() some data structures in wait_for_pager().  Reduce
these unsafe calls.

* ti/glibc-stdio-mutex-from-signal-handler:
  pager: don't use unsafe functions in signal handlers
2015-10-07 13:38:16 -07:00
Tobias Klauser a43eb67e65 Documentation/interpret-trailers: Grammar fix
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-07 10:53:34 -07:00
Johannes Schindelin 786b150c8d clone --dissociate: avoid locking pack files
When `git clone` is asked to dissociate the repository from the
reference repository whose objects were used, it is quite possible that
the pack files need to be repacked. In that case, the pack files need to
be deleted that were originally hard-links to the reference repository's
pack files.

On platforms where a file cannot be deleted if another process still
holds a handle on it, we therefore need to take pains to release all
pack files and indexes before dissociating.

This fixes https://github.com/git-for-windows/git/issues/446

The test case to demonstrate the breakage technically does not need to
be run on Linux or MacOSX. It won't hurt, either, though.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-07 10:47:50 -07:00
Johannes Schindelin 38849a8116 sha1_file.c: add a function to release all packs
On Windows, files that are in use cannot be removed or renamed. That
means that we have to release pack files when we are about to, say,
repack them. Let's introduce a convenient function to close all the
pack files and their idx files.

While at it, we consolidate the close windows/close fd/close index
stanza in `free_pack_by_name()` into the `close_pack()` function that
is used by the new `close_all_packs()` function to avoid repeated code.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-07 10:47:10 -07:00
Michael J Gruber ba128e2375 t2026: rename worktree prune test
Linked checkouts are known under the name worktree, now. Rename the test
accordingly.

Specifically, this avoids the confusion that t2026 is actually not about
pruning in or with linked checkouts aka worktress but about pruning
worktrees, i.e. about "git worktree prune" rather than "git prune".

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-07 10:39:32 -07:00
Eric N. Vander Weele fd8d07efda log: Update log.follow doc and add to config.txt
Documentation/config.txt does not include the documentation for
log.follow that is in Documentation/git-log.txt.  This commit adds the
log.follow documentation to config.txt and also updates the wording to
be consistent with the format that is followed by other boolean
configuration variables.

Signed-off-by: Eric N. Vander Weele <ericvw@gmail.com>
Acked-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-07 10:37:48 -07:00
Matthieu Moy 1db168ee97 rebase-i: loosen over-eager check_bad_cmd check
804098bb (git rebase -i: add static check for commands and SHA-1,
2015-06-29) tried to check all insns before running any in the todo
list, but it did so by implementing its own parser that is a lot
stricter than necessary.  We used to allow lines that are indented
(including comment lines), and we used to allow a whitespace between
the insn and the commit object name to be HT, among other things,
that are flagged as an invalid line by mistake.

Fix this by using the same tokenizer that is used to parse the todo
list file in the new check.

Whether it's a good thing to accept indented comments is
debatable (other commands like "git commit" do not accept them), but we
already accepted them in the past, and some people and scripts rely on
this behavior. Also, a line starting with space followed by a '#' cannot
have any meaning other than being a comment, hence it doesn't harm to
accept them as comments.

Largely based on patch by: Junio C Hamano <gitster@pobox.com>

[jc: updated test with quickfix from Torsten Bögershausen]

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-05 22:39:56 -07:00
Johannes Schindelin 8c845cde99 gc: demonstrate failure with stale remote HEAD
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-05 14:56:57 -07:00
Johannes Schindelin 71fe5d7fb0 sha1_file: consolidate code to close a pack's file descriptor
There was a lot of repeated code to close the file descriptor of
a given pack. Let's just refactor this code into a single function.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-05 14:43:58 -07:00
Johannes Schindelin 11911bf7c4 t5700: demonstrate a Windows file locking issue with git clone --dissociate
On Windows, dissociating from a reference can fail very easily due to
pack files that are still in use when they want to be removed.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-05 14:43:44 -07:00
Junio C Hamano 24a00ef646 Start cycle toward 2.7
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-05 13:20:21 -07:00
Junio C Hamano 590f6e4235 Sync with 2.6.1 2015-10-05 13:20:08 -07:00
Junio C Hamano e13d854322 Merge branch 'mm/keyid-docs'
Very small number of options take a parameter that is optional
(which is not a great UI element as they can only appear at the end
of the command line).  Add notice to documentation of each and
every one of them.

* mm/keyid-docs:
  Documentation: explain optional arguments better
  Documentation/grep: fix documentation of -O
  Documentation: use 'keyid' consistently, not 'key-id'
2015-10-05 12:30:26 -07:00
Junio C Hamano e437cbd015 Merge branch 'bb/remote-get-url'
"git remote" learned "get-url" subcommand to show the URL for a
given remote name used for fetching and pushing.

* bb/remote-get-url:
  remote: add get-url subcommand
2015-10-05 12:30:25 -07:00