Commit graph

41105 commits

Author SHA1 Message Date
Waldek Maleska fdcdb77855 Correct fscanf formatting string for I64u values
This fix is probably purely cosmetic because PRIuMAX is likely identical
to SCNuMAX. Nevertheless, when using a function of the scanf() family,
the correct interpolation to use is the latter, not the former.

Signed-off-by: Waldek Maleska <w.maleska@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-26 13:24:03 -07:00
Johannes Schindelin 56a1a3ab44 Silence GCC's "cast of pointer to integer of a different size" warning
When calculating hashes from pointers, it actually makes sense to cut
off the most significant bits. In that case, said warning does not make
a whole lot of sense.

So let's just work around it by casting the pointer first to intptr_t
and then casting up/down to the final integral type.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-26 13:24:03 -07:00
Johannes Schindelin 8f77442358 Squelch warning about an integer overflow
We cannot rely on long integers to have more than 32 bits.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-26 13:23:59 -07:00
Johannes Schindelin 71d9257525 imap-send: only use CURLOPT_LOGIN_OPTIONS if it is actually available
This fixes the compilation on an older Linux that was used to debug
test failures when upgrading Git for Windows to Git v2.3.0.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-26 13:10:30 -07:00
Max Kirillov 95261974bb blame: fix option name in error message
The option name used in blame's UI is `--reverse`.

Signed-off-by: Max Kirillov <max@max630.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-26 13:08:21 -07:00
Xue Fuqiao b2af4829cc user-manual: fix the description of fast-forward
The "Fast-forward merges" section of user-manual.txt incorrectly
says if the current branch is a descendant of the other, Git will
perform a fast-forward merge, but it should the other way around.

Signed-off-by: Xue Fuqiao <xfq.free@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-26 13:03:44 -07:00
Junio C Hamano 29abb33978 add: simplify -u/-A without pathspec
Since Git 2.0, "add -u" and "add -A" run from a subdirectory without
any pathspec mean "everything in the working tree" (before 2.0, they
were limited to the current directory).  The limiting to the current
directory was implemented by inserting "." to the command line when
the end user did not give us any pathspec.  At 2.0, we updated the
code to insert ":/" (instead of '.') to consider everything from the
top-level, by using a pathspec magic "top".

The call to parse_pathspec() using the command line arguments is,
however, made with PATHSPEC_PREFER_FULL option since 5a76aff1 (add:
convert to use parse_pathspec, 2013-07-14), which predates Git 2.0.
In retrospect, there was no need to turn "adding . to limit to the
directory" into "adding :/ to unlimit to everywhere" in Git 2.0;
instead we could just have done "if there is no pathspec on the
command line, just let it be".  The parse_pathspec() then would give
us a pathspec that matches everything and all is well.

Incidentally such a simplification also fixes a corner case bug that
stems from the fact that ":/" does not necessarily mean any magic.
A user would say "git --literal-pathspecs add -u :/" from the
command line when she has a directory ':' and wants to add
everything in it (and she knows that her :/ will be taken as
'everything under the sun' magic pathspec unless she disables the
magic with --literal-pathspecs).  The internal use of ':/' would
behave the same way as such an explicitly given ":/" when run with
"--literal-pathspecs", and will not add everything under the sun as
the code originally intended.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-24 19:32:47 -07:00
Junio C Hamano 3b19dba703 Documentation: AsciiDoc spells em-dash as double-dashes, not triple
Again, we do not usually process release notes with AsciiDoc, but it
is better to be consistent.

This incidentally reveals breakages left by an ancient 5e00439f
(Documentation: build html for all files in technical and howto,
2012-10-23).  The index-format documentation was originally written
to be read as straight text without formatting and when the commit
forced everything in Documentation/ to go through AsciiDoc, it did
not do any adjustment--hence the double-dashes will be seen in the
resulting text that is rendered as preformatted fixed-width without
converted into em-dashes.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-22 13:02:33 -07:00
Junio C Hamano 77d5f715c2 Documentation: match undefline with the text in old release notes
These are not processed with AsciiDoc, but it is better to be
consistent.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-22 10:16:17 -07:00
Junio C Hamano 142d035a02 Documentation: match underline with the text
Even though AsciiDoc is more lenient when deciding if an underline
is for the contents on the previous line to find section headers, we
should match the length of them for other formatters to help them.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-22 10:16:12 -07:00
Junio C Hamano f3f38c7d9b Documentation/everyday: match undefline with the text
Even though AsciiDoc is more lenient when deciding if an underline
is for the contents on the previous line to find section headers, we
should match the length of them for other formatters to help them.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-22 10:14:44 -07:00
Xue Fuqiao a3e1fa97bc Documentation: fix header markup
Asciidoctor is stricter than AsciiDoc when deciding if underlining
is a section title or the start of preformatted text.  Make the
length of the underlining match the text to ensure that it renders
correctly in all implementations.

Signed-off-by: Xue Fuqiao <xfq.free@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-22 09:35:36 -07:00
David Turner 41284eb0f9 name-hash: don't reuse cache_entry in dir_entry
Stop reusing cache_entry in dir_entry; doing so causes a
use-after-free bug.

During merges, we free entries that we no longer need in the
destination index.  But those entries might have also been stored in
the dir_entry cache, and when a later call to add_to_index found them,
they would be used after being freed.

To prevent this, change dir_entry to store a copy of the name instead
of a pointer to a cache_entry.  This entails some refactoring of code
that expects the cache_entry.

Keith McGuigan <kmcguigan@twitter.com> diagnosed this bug and wrote
the initial patch, but this version does not use any of Keith's code.

Helped-by: Keith McGuigan <kmcguigan@twitter.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-21 12:47:38 -07:00
Remi Pommarel 7e91e8d73a configure.ac: detect ssl need with libcurl
When libcurl has been statically compiled with openssl support they both
need to be linked in everytime libcurl is used.

During configuration this can be detected by looking for Curl_ssl_init
function symbol in libcurl, which will only be present if libcurl has been
compiled statically built with openssl.

configure.ac checks for Curl_ssl_init function in libcurl and if such function
exists; it sets NEEDS_SSL_WITH_CURL that is used by the Makefile to include
-lssl alongside with -lcurl.

Signed-off-by: Remi Pommarel <repk@triplefau.lt>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-21 12:44:44 -07:00
Remi Pommarel f89158760d Makefile: make curl-config path configurable
There are situations, e.g. during cross compilation, where curl-config
program is not present in the PATH.

Make the makefile use a configurable curl-config program passed through
CURL_CONFIG variable which can be set through config.mak.

Also make this variable tunable through use of autoconf/configure. Configure
will set CURL_CONFIG variable in config.mak.autogen to whatever value has been
passed to ac_cv_prog_CURL_CONFIG.

Signed-off-by: Remi Pommarel <repk@triplefau.lt>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-21 12:43:31 -07:00
Remi Pommarel 9eaa78b0b0 Makefile: link libcurl before zlib
For static linking especially library order while linking is important. For
example, libcurl wants symbols from zlib when building http-push, http-fetch
and remote-curl. So for these programs libcurl has to be linked before zlib.

Signed-off-by: Remi Pommarel <repk@triplefau.lt>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-21 12:43:03 -07:00
Junio C Hamano b05c2f9ed4 Merge branch 'js/gc-with-stale-symref' into maint
"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-20 15:22:42 -07:00
Junio C Hamano 3b7c49e9a3 Merge branch 'rd/test-path-utils' into maint
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-20 15:22:41 -07:00
Junio C Hamano ce555f3842 Merge branch 'jc/doc-gc-prune-now' into maint
"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-20 15:22:40 -07:00
Junio C Hamano 44a9b53c59 Merge branch 'jk/filter-branch-use-of-sed-on-incomplete-line' into maint
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-20 15:22:39 -07:00
David Turner 9b680fbd3b t7063: fix flaky untracked-cache test
Dirty the test worktree's root directory, as the test expects.

When testing the untracked-cache, we previously assumed that checking
out master would be sufficient to mark the mtime of the worktree's
root directory as racily-dirty.  But sometimes, the checkout would
happen at 12345.999 seconds and the status at 12346.001 seconds,
meaning that the worktree's root directory would not be racily-dirty.
And since it was not truly dirty, occasionally the test would fail.
By making the root truly dirty, the test will always succeed.

Tested by running a few hundred times.

Signed-off-by: David Turner <dturner@twopensource.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-19 18:32:28 -07:00
Junio C Hamano 1b5ffa36cb Merge branch 'maint' of git://github.com/git-l10n/git-po into maint
* 'maint' of git://github.com/git-l10n/git-po:
  l10n: ru.po: update Russian translation
2015-10-18 23:37:35 -07:00
Sidhant Sharma ae9f2745be worktree: usage: denote <branch> as optional with 'add'
Although 1eb07d8 (worktree: add: auto-vivify new branch when
<branch> is omitted, 2015-07-06) updated the documentation when
<branch> became optional, it neglected to update the in-code
usage message. Fix this oversight.

Reported-by: ch3cooli@gmail.com
Signed-off-by: Sidhant Sharma <tigerkid001@gmail.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-18 23:35:58 -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 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