Commit graph

41376 commits

Author SHA1 Message Date
Junio C Hamano e38ee06e99 mailinfo: explicitly close file handle to the patch output
This does not make a difference within the context of "git mailinfo"
that runs once and exits, as flushing and closing would happen upon
process termination.  It however will matter when we eventually make
it callable as an API function.

Besides, cleaning after yourself once you are done is a good hygiene.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-18 22:13:27 -07:00
Junio C Hamano b6af8ed13a mailinfo: fix an off-by-one error in the boundary stack
We pre-increment the pointer that we will use to store something at,
so the pointer is already beyond the end of the array if it points
at content[MAX_BOUNDARIES].

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-18 22:13:27 -07:00
Junio C Hamano 3a8fcdaf84 mailinfo: fold decode_header_bq() into decode_header()
In olden days we might have wanted to behave differently in
decode_header() if the header line was encoded with RFC2047, but we
apparently do not do so, hence this helper function can go, together
with its return value.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-18 22:13:27 -07:00
Junio C Hamano 2a5ce7cf0d mailinfo: remove a no-op call convert_to_utf8(it, "")
The called function checks if the second parameter is either a NULL
or an empty string at the very beginning and returns without doing
anything.  Remove the useless call.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-18 22:13:27 -07:00
Karthik Nayak 008ed7df93 tag.c: use the correct algorithm for the '--contains' option
In b7cc53e9 (tag.c: use 'ref-filter' APIs, 2015-09-11) we port tag.c
to use the ref-filter APIs for filtering and printing refs.  In
ref-filter we have two implementations for filtering refs when the
'--contains' option is used.

Although they do the same thing, one is optimized for filtering
branches and the other for tags (borrowed from branch.c and tag.c
respectively) and the 'filter->with_commit_tag_algo' bit decides
which algorithm must be used.  We should unify these.

When we ported tag.c to use ref-filter APIs we missed out on setting
the 'filter->with_commit_tag_algo' bit.  As reported by Jerry
Snitselaar, this causes "git tag --contains" to work way slower than
expected, fix this by setting 'filter->with_commit_tag_algo' in
tag.c before calling 'filter_refs()'.

Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Tested-by: Jerry Snitselaar <jsnitsel@redhat.com>
Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-18 16:07:36 -07:00
Junio C Hamano 33e8fc8740 usage: do not insist that standard input must come from a file
The synopsys text and the usage string of subcommands that read list
of things from the standard input are often shown like this:

	git gostak [--distim] < <list-of-doshes>

This is problematic in a number of ways:

 * The way to use these commands is more often to feed them the
   output from another command, not feed them from a file.

 * Manual pages outside Git, commands that operate on the data read
   from the standard input, e.g "sort", "grep", "sed", etc., are not
   described with such a "< redirection-from-file" in their synopsys
   text.  Our doing so introduces inconsistency.

 * We do not insist on where the output should go, by saying

	git gostak [--distim] < <list-of-doshes> > <output>

 * As it is our convention to enclose placeholders inside <braket>,
   the redirection operator followed by a placeholder filename
   becomes very hard to read, both in the documentation and in the
   help text.

Let's clean them all up, after making sure that the documentation
clearly describes the modes that take information from the standard
input and what kind of things are expected on the input.

[jc: stole example for fmt-merge-msg from Jonathan]

Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-16 15:27:52 -07:00
Junio C Hamano 0c4dd78434 Git 2.6.2
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJWIW7HAAoJELC16IaWr+bLrDAP/iyXz6A2ooVM/9/c3XzzZqSk
 njU1C5frBoHHe9Xa/RMTnhVTK8zQLfcjpo2YGuQ+t9rmwKZ045c8EE5o1cx0fc4y
 WFt36rOYirp3m52l95p5EwfRXvHupk9Pk8xsh1j8nuFNKMpDCuhXfY0gLyBlD3Fs
 c8tKzAPgN9wTkZO0RlpKmmVIeI60UTik99fp6Wbc4jovomSH3IK+roEKPXfoqI1m
 l7zrIynDV3POUqLUzTulx9pIjbZpCh+djWOMVPbnoTPR59vZaUScdhyml+iNaLtR
 QGsu8+amzuTz6n/voECKy+v5cyZGWTgsvOcgqP+U+R8wmOjXSy5LANDQ7nq+V0UO
 JZauiUy+KFjeFd7tYq9fRN2XKMkpbDR6ocPLWQ+yJrHXv71ImxG5LpRV9iHbfBdL
 q1jCipsnuvIX0BuOT6EIs7F/dJbvKJlSFXajkokuFmYuIp/nr5zA3dArI9tnkhJ2
 ye8Ck33mR/XeXMXBCLErECFSLRr8QD2TjFipiGa7XT7cIITgVimwRcCJ/86SU9VA
 G9yQ4cdj5exK4/iAG8HpGxN+NwaQvdSD3425Wq4+I0KaGsV6itEXm1WyU1tvqFzj
 HU2hOwiyzCsGG0BX+nmsFa13ALUyqB5saZNrAJjEEJFGmq4MzzEoTXCpOFrTFj/M
 JC9YKCI4Smx4+QtTuzaK
 =ObN4
 -----END PGP SIGNATURE-----

Sync with 2.6.2
2015-10-16 14:45:49 -07:00
Junio C Hamano 906c32b9c3 Fifth batch for 2.7
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-16 14:44:00 -07:00
Junio C Hamano d5d1e35ace Merge branch 'jc/doc-gc-prune-now'
"git gc" is safe to run anytime only because it has the built-in
grace period to protect young objects.  In order to run with no
grace period, the user must make sure that the repository is
quiescent.

* jc/doc-gc-prune-now:
  Documentation/gc: warn against --prune=<now>
2015-10-16 14:42:50 -07:00
Junio C Hamano 8b70042569 Merge branch 'sb/submodule-config-parse'
Code simplification.

* sb/submodule-config-parse:
  submodule-config: "goto" removal in parse_config()
2015-10-16 14:42:49 -07:00
Junio C Hamano 1551511bdb Merge branch 'jk/filter-branch-use-of-sed-on-incomplete-line'
A recent "filter-branch --msg-filter" broke skipping of the commit
object header, which is fixed.

* jk/filter-branch-use-of-sed-on-incomplete-line:
  filter-branch: remove multi-line headers in msg filter
2015-10-16 14:42:47 -07:00
Junio C Hamano c6185c0b17 Merge branch 'rd/test-path-utils'
The normalize_ceiling_entry() function does not muck with the end
of the path it accepts, and the real world callers do rely on that,
but a test insisted that the function drops a trailing slash.

* rd/test-path-utils:
  test-path-utils.c: remove incorrect assumption
2015-10-16 14:42:46 -07:00
Junio C Hamano 3c3d3f629a Git 2.6.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-16 14:40:05 -07:00
Junio C Hamano 119ffa3351 Merge branch 'cc/quote-comments' into maint
A no-op code-health maintenance.

* cc/quote-comments:
  quote: move comment before sq_quote_buf()
  quote: fix broken sq_quote_buf() related comment
2015-10-16 14:32:58 -07:00
Junio C Hamano 71ae53526d Merge branch 'es/worktree-add-cleanup' into maint
A no-op code-health maintenance.

* es/worktree-add-cleanup:
  t2026: rename worktree prune test
2015-10-16 14:32:57 -07:00
Junio C Hamano 0dd9e571e8 Merge branch 'tk/doc-interpret-trailers-grammo' into maint
* tk/doc-interpret-trailers-grammo:
  Documentation/interpret-trailers: Grammar fix
2015-10-16 14:32:56 -07:00
Junio C Hamano 9ab74762cd Merge branch 'tk/typofix-connect-unknown-proto-error' into maint
* tk/typofix-connect-unknown-proto-error:
  connect: fix typo in result string of prot_name()
2015-10-16 14:32:55 -07:00
Junio C Hamano aa8f64dead Merge branch 'jk/asciidoctor-section-heading-markup-fix' into maint
* jk/asciidoctor-section-heading-markup-fix:
  Documentation: fix section header mark-up
2015-10-16 14:32:53 -07:00
Junio C Hamano 22f4b15e88 Merge branch 'nd/ls-remote-does-not-have-u-option' into maint
* nd/ls-remote-does-not-have-u-option:
  ls-remote.txt: delete unsupported option
2015-10-16 14:32:52 -07:00
Junio C Hamano 1c7dc12c43 Merge branch 'jc/fsck-dropped-errors' into maint
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-16 14:32:50 -07:00
Junio C Hamano 8f6f1771da Merge branch 'sb/http-flaky-test-fix' into maint
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-16 14:32:49 -07:00
Junio C Hamano 2c3cb52c6c Merge branch 'sb/perf-without-installed-git' into maint
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-16 14:32:47 -07:00
Junio C Hamano 15cef7ccd9 Merge branch 'js/icase-wt-detection' into maint
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-16 14:32:46 -07:00
Junio C Hamano 14f1467493 Merge branch 'pt/am-builtin' into maint
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-16 14:32:45 -07:00
Junio C Hamano df64186f63 Merge branch 'mm/detach-at-HEAD-reflog' into maint
After "git checkout --detach", "git status" reported a fairly
useless "HEAD detached at HEAD", instead of saying at which exact
commit.

* mm/detach-at-HEAD-reflog:
  status: don't say 'HEAD detached at HEAD'
  t3203: test 'detached at' after checkout --detach
2015-10-16 14:32:44 -07:00
Junio C Hamano 19d11d43fd Merge branch 'gr/rebase-i-drop-warn' into maint
"git rebase -i" had a minor regression recently, which stopped
considering a line that begins with an indented '#' in its insn
sheet not a comment, which is now fixed.

* gr/rebase-i-drop-warn:
  rebase-i: loosen over-eager check_bad_cmd check
  rebase-i: explicitly accept tab as separator in commands
2015-10-16 14:32:43 -07:00
Junio C Hamano d5fea2418e Merge branch 'dt/log-follow-config' into maint
Description of the "log.follow" configuration variable in "git log"
documentation is now also copied to "git config" documentation.

* dt/log-follow-config:
  log: Update log.follow doc and add to config.txt
2015-10-16 14:32:42 -07:00
Junio C Hamano 267ebf6c84 Merge branch 'ti/glibc-stdio-mutex-from-signal-handler' into maint
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-16 14:32:41 -07:00
Junio C Hamano f4892a3c28 Merge branch 'jk/notes-dwim-doc' into maint
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-16 14:32:40 -07:00
Junio C Hamano 47c566a4d6 Merge branch 'jk/make-findstring-makeflags-fix' into maint
Customization to change the behaviour with "make -w" and "make -s"
in our Makefile was broken when they were used together.

* jk/make-findstring-makeflags-fix:
  Makefile: fix MAKEFLAGS tests with multiple flags
2015-10-16 14:32:38 -07:00
Junio C Hamano 4d2a3011ee Merge branch 'jw/make-arflags-customizable' into maint
The Makefile always runs the library archiver with hardcoded "crs"
options, which was inconvenient for exotic platforms on which
people want to use programs with totally different set of command
line options.

* jw/make-arflags-customizable:
  Makefile: allow $(ARFLAGS) specified from the command line
2015-10-16 14:32:36 -07:00
Junio C Hamano a3bbfe5d00 Merge branch 'jk/connect-clear-env' into maint
The ssh transport, just like any other transport over the network,
did not clear GIT_* environment variables, but it is possible to
use SendEnv and AcceptEnv to leak them to the remote invocation of
Git, which is not a good idea at all.  Explicitly clear them just
like we do for the local transport.

* jk/connect-clear-env:
  git_connect: clarify conn->use_shell flag
  git_connect: clear GIT_* environment for ssh
2015-10-16 14:32:35 -07:00
Junio C Hamano 14d5a3e47e Merge branch 'jk/blame-first-parent' into maint
"git blame --first-parent v1.0..v2.0" was not rejected but did not
limit the blame to commits on the first parent chain.

* jk/blame-first-parent:
  blame: handle --first-parent
2015-10-16 14:32:34 -07:00
Junio C Hamano be4d6f4c7f Merge branch 'mm/keyid-docs' into maint
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-16 14:32:33 -07:00
Junio C Hamano c7997e54a5 Merge branch 'pt/pull-builtin' into maint
* pt/pull-builtin:
  pull: enclose <options> in brackets in the usage string
  merge: grammofix in please-commit-before-merge message
2015-10-16 14:32:32 -07:00
Ralf Thielow d96a0313ef am, credential-cache: add angle brackets to usage string
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-16 10:43:41 -07:00
Tobias Klauser bed4452468 stripspace: use parse-options for command-line parsing
Use parse-options to parse command-line options instead of a
hand-crafted implementation.  The users can now use a unique
prefix of the long option to say e.g. "git stripspace --strip".

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-16 10:28:49 -07:00
Tobias Klauser 63af4a8446 strbuf: make stripspace() part of strbuf
This function is also used in other builtins than stripspace, so it
makes sense to have it in a more generic place.  Since it operates
on an strbuf and the function is declared in strbuf.h, move it to
strbuf.c and add the corresponding prefix to its name, just like
other API functions in the strbuf_* family.

Also switch all current users of stripspace() to the new function
name and keep a temporary wrapper inline function for any topic
branches still using stripspace().

Reviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-16 09:45:15 -07:00
Alex Henrie e7a7401f8b pull: enclose <options> in brackets in the usage string
All the other placeholders are already shown that way.

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-16 09:38:32 -07:00
Junio C Hamano a838ae9d49 Fourth batch for 2.7
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-15 15:48:56 -07:00
Junio C Hamano 6ff518f593 Merge branch 'ls/p4-lfs'
Teach "git p4" to send large blobs outside the repository by
talking to Git LFS.

* ls/p4-lfs:
  git-p4: add Git LFS backend for large file system
  git-p4: add support for large file systems
  git-p4: check free space during streaming
  git-p4: add file streaming progress in verbose mode
  git-p4: return an empty list if a list config has no values
  git-p4: add gitConfigInt reader
  git-p4: add optional type specifier to gitConfig reader
2015-10-15 15:43:53 -07:00
Junio C Hamano 1018f3eea4 Merge branch 'js/gc-with-stale-symref'
"git gc" used to barf when a symbolic ref has gone dangling
(e.g. the branch that used to be your upstream's default when you
cloned from it is now gone, and you did "fetch --prune").

* js/gc-with-stale-symref:
  pack-objects: do not get distracted by broken symrefs
  gc: demonstrate failure with stale remote HEAD
2015-10-15 15:43:51 -07:00
Junio C Hamano db5adf24bf Merge branch 'js/clone-dissociate'
"git clone --dissociate" runs a big "git repack" process at the
end, and it helps to close file descriptors that are open on the
packs and their idx files before doing so on filesystems that
cannot remove a file that is still open.

* js/clone-dissociate:
  clone --dissociate: avoid locking pack files
  sha1_file.c: add a function to release all packs
  sha1_file: consolidate code to close a pack's file descriptor
  t5700: demonstrate a Windows file locking issue with `git clone --dissociate`
2015-10-15 15:43:49 -07:00
Junio C Hamano b80dd559c9 Merge branch 'tk/doc-interpret-trailers-grammo'
* tk/doc-interpret-trailers-grammo:
  Documentation/interpret-trailers: Grammar fix
2015-10-15 15:43:48 -07:00
Junio C Hamano 91ece0fc1d Merge branch 'es/worktree-add-cleanup'
A no-op code-health maintenance.

* es/worktree-add-cleanup:
  t2026: rename worktree prune test
2015-10-15 15:43:47 -07:00
Junio C Hamano 50337d0f71 Merge branch 'dt/log-follow-config'
Description of the "log.follow" configuration variable in "git log"
documentation is now also copied to "git config" documentation.

* dt/log-follow-config:
  log: Update log.follow doc and add to config.txt
2015-10-15 15:43:46 -07:00
Junio C Hamano 1811f93522 Merge branch 'cc/quote-comments'
A no-op code-health maintenance.

* cc/quote-comments:
  quote: move comment before sq_quote_buf()
  quote: fix broken sq_quote_buf() related comment
2015-10-15 15:43:45 -07:00
Junio C Hamano 633a8bdddf Merge branch 'gr/rebase-i-drop-warn'
"git rebase -i" had a minor regression recently, which stopped
considering a line that begins with an indented '#' in its insn
sheet not a comment, which is now fixed.

* gr/rebase-i-drop-warn:
  rebase-i: loosen over-eager check_bad_cmd check
  rebase-i: explicitly accept tab as separator in commands
2015-10-15 15:43:44 -07:00
Junio C Hamano a394b39726 Merge branch 'mm/detach-at-HEAD-reflog'
After "git checkout --detach", "git status" reported a fairly
useless "HEAD detached at HEAD", instead of saying at which exact
commit.

* mm/detach-at-HEAD-reflog:
  status: don't say 'HEAD detached at HEAD'
  t3203: test 'detached at' after checkout --detach
2015-10-15 15:43:42 -07:00
Junio C Hamano 50a5e697b4 Merge branch 'sa/send-email-smtp-batch-data-limit'
When "git send-email" wanted to talk over Net::SMTP::SSL,
Net::Cmd::datasend() did not like to be fed too many bytes at the
same time and failed to send messages.  Send the payload one line
at a time to work around the problem.

* sa/send-email-smtp-batch-data-limit:
  git-send-email.perl: Fixed sending of many/huge changes/patches
2015-10-15 15:43:41 -07:00