1
0
mirror of https://github.com/git/git.git synced 2024-10-21 11:38:56 +02:00
Commit Graph

35513 Commits

Author SHA1 Message Date
Junio C Hamano
540cc75f38 Merge branch 'mh/shorten-unambigous-ref'
* mh/shorten-unambigous-ref:
  shorten_unambiguous_ref(): tighten up pointer arithmetic
  gen_scanf_fmt(): delete function and use snprintf() instead
  shorten_unambiguous_ref(): introduce a new local variable
2014-01-13 11:34:08 -08:00
Junio C Hamano
272220ff67 Merge branch 'mm/mv-file-to-no-such-dir-with-slash'
Finishing touches to do the same on windows.

* mm/mv-file-to-no-such-dir-with-slash:
  mv: let 'git mv file no-such-dir/' error out on Windows, too
2014-01-13 11:33:51 -08:00
Junio C Hamano
a65a53bf04 Merge branch 'jl/submodule-mv-checkout-caveat'
With a submodule that was initialized in an old fashioned way
without gitlinks, switching branches in the superproject between
the one with and without the submodule may leave the submodule
working tree with its embedded repository behind, as there may be
unexpendable state there. Document and warn users about this.

* jl/submodule-mv-checkout-caveat:
  rm: better document side effects when removing a submodule
  mv: better document side effects when moving a submodule
2014-01-13 11:33:47 -08:00
Junio C Hamano
5e72e7168c Merge branch 'jk/pull-rebase-using-fork-point'
Finishing touches.

* jk/pull-rebase-using-fork-point:
  rebase: fix fork-point with zero arguments
2014-01-13 11:33:40 -08:00
Junio C Hamano
ca46578a1d Merge branch 'rr/completion-format-coverletter'
The bash/zsh completion code did not know about format.coverLetter
among many format.* configuration variables.

* rr/completion-format-coverletter:
  completion: complete format.coverLetter
2014-01-13 11:33:38 -08:00
Junio C Hamano
ff724276cd Merge branch 'ow/stash-with-ifs'
The implementation of 'git stash $cmd "stash@{...}"' did not quote
the stash argument properly and left it split at IFS whitespace.

* ow/stash-with-ifs:
  stash: handle specifying stashes with $IFS
2014-01-13 11:33:37 -08:00
Junio C Hamano
9fac0777e1 Merge branch 'jn/pager-lv-default-env'
Just like we give a reasonable default for "less" via the LESS
environment variable, specify a reasonable default for "lv" via the
"LV" environment variable when spawning the pager.

* jn/pager-lv-default-env:
  pager: set LV=-c alongside LESS=FRSX
2014-01-13 11:33:35 -08:00
Junio C Hamano
0a8cb03555 Merge branch 'br/sha1-name-40-hex-no-disambiguation'
When parsing a 40-hex string into the object name, the string is
checked to see if it can be interpreted as a ref so that a warning
can be given for ambiguity. The code kicked in even when the
core.warnambiguousrefs is set to false to squelch this warning, in
which case the cycles spent to look at the ref namespace were an
expensive no-op, as the result was discarded without being used.

* br/sha1-name-40-hex-no-disambiguation:
  sha1_name: don't resolve refs when core.warnambiguousrefs is false
2014-01-13 11:33:29 -08:00
Johannes Sixt
a893346930 mv: let 'git mv file no-such-dir/' error out on Windows, too
The previous commit c57f628 (mv: let 'git mv file no-such-dir/' error out)
relies on that rename("file", "no-such-dir/") fails if the directory does not
exist (note the trailing slash).  This does not work as expected on Windows:
This rename() call does not fail, but renames "file" to "no-such-dir" (not to
"no-such-dir/file"). Insert an explicit check for this case to force an error.

This changes the error message from

   $ git mv file no-such-dir/
   fatal: renaming 'file' failed: Not a directory

to

   $ git mv file no-such-dir/
   fatal: destination directory does not exist, source=file, destination=no-such-dir/

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-01-10 11:28:12 -08:00
Junio C Hamano
a25014bc4c Update draft release notes to 1.9
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-01-10 11:25:01 -08:00
Junio C Hamano
74ca49330a Merge branch 'ss/builtin-cleanup'
"git help $cmd" unnecessarily enumerated potential command names
from the filesystem, even when $cmd is known to be a built-in.

Ideas for further optimization, primarily by killing the use of
is_in_cmdlist(), were suggested in the discussion, but they can
come as follow-ups on top of this series.

* ss/builtin-cleanup:
  builtin/help.c: speed up is_git_command() by checking for builtin commands first
  builtin/help.c: call load_command_list() only when it is needed
  git.c: consistently use the term "builtin" instead of "internal command"
2014-01-10 10:33:48 -08:00
Junio C Hamano
4243b2d1e4 Merge branch 'vm/octopus-merge-bases-simplify'
* vm/octopus-merge-bases-simplify:
  get_octopus_merge_bases(): cleanup redundant variable
2014-01-10 10:33:45 -08:00
Junio C Hamano
2b2849765f Merge branch 'ta/format-user-manual-as-an-article'
Update the way the user-manual is formatted via AsciiDoc to save
trees.

* ta/format-user-manual-as-an-article:
  user-manual: improve html and pdf formatting
2014-01-10 10:33:43 -08:00
Junio C Hamano
30159e530d Merge branch 'rr/completion-branch-config'
Two-level configuration variable names in "branch.*" and "remote.*"
hierarchies whose variables are predominantly three-level where not
completed by hitting a <TAB> in bash and zsh completions.

* rr/completion-branch-config:
  completion: fix remote.pushdefault
  completion: fix branch.autosetup(merge|rebase)
  completion: introduce __gitcomp_nl_append ()
  zsh completion: find matching custom bash completion
2014-01-10 10:33:39 -08:00
Junio C Hamano
3b9d69ec22 Merge branch 'js/lift-parent-count-limit'
There is no reason to have a hardcoded upper limit of the number of
parents for an octopus merge, created via the graft mechanism.

* js/lift-parent-count-limit:
  Remove the line length limit for graft files
2014-01-10 10:33:36 -08:00
Junio C Hamano
f0f493ec58 Merge branch 'jk/test-framework-updates'
The basic test used to leave unnecessary trash directories in the
t/ directory.

* jk/test-framework-updates:
  t0000: drop "known breakage" test
  t0000: simplify HARNESS_ACTIVE hack
  t0000: set TEST_OUTPUT_DIRECTORY for sub-tests
2014-01-10 10:33:34 -08:00
Junio C Hamano
d5d1678b9c Merge branch 'bm/merge-base-octopus-dedup'
"git merge-base --octopus" used to leave cleaning up suboptimal
result to the caller, but now it does the clean-up itself.

* bm/merge-base-octopus-dedup:
  merge-base --octopus: reduce the result from get_octopus_merge_bases()
  merge-base: separate "--independent" codepath into its own helper
2014-01-10 10:33:33 -08:00
Junio C Hamano
55869681f1 Merge branch 'km/gc-eperm'
A "gc" process running as a different user should be able to stop a
new "gc" process from starting.

* km/gc-eperm:
  gc: notice gc processes run by other users
2014-01-10 10:33:30 -08:00
Junio C Hamano
35a116d740 Merge branch 'jk/http-auth-tests-robustify'
Using the same username and password during the tests would not
catch a potential breakage of sending one when we should be sending
the other.

* jk/http-auth-tests-robustify:
  use distinct username/password for http auth tests
2014-01-10 10:33:19 -08:00
Junio C Hamano
56e648e253 Merge branch 'jk/credential-plug-leak'
An earlier "clean-up" introduced an unnecessary memory leak.

* jk/credential-plug-leak:
  Revert "prompt: clean up strbuf usage"
2014-01-10 10:33:16 -08:00
Junio C Hamano
962fa6539c Merge branch 'bs/mirbsd'
* bs/mirbsd:
  Add MirBSD support to the build system.
2014-01-10 10:33:14 -08:00
Junio C Hamano
34aacf30a3 Merge branch 'nd/commit-tree-constness'
Code clean-up.

* nd/commit-tree-constness:
  commit.c: make "tree" a const pointer in commit_tree*()
2014-01-10 10:33:13 -08:00
Junio C Hamano
b2132068c6 Merge branch 'jk/oi-delta-base'
Teach "cat-file --batch" to show delta-base object name for a
packed object that is represented as a delta.

* jk/oi-delta-base:
  cat-file: provide %(deltabase) batch format
  sha1_object_info_extended: provide delta base sha1s
2014-01-10 10:33:11 -08:00
Junio C Hamano
f06a5e607d Merge branch 'jk/sha1write-void'
Code clean-up.

* jk/sha1write-void:
  do not pretend sha1write returns errors
2014-01-10 10:33:09 -08:00
Junio C Hamano
4ba46c2847 Merge branch 'nd/add-empty-fix'
"git add -A" (no other arguments) in a totally empty working tree
used to emit an error.

* nd/add-empty-fix:
  add: don't complain when adding empty project root
2014-01-10 10:33:03 -08:00
Junio C Hamano
0c52457b7c Merge branch 'nd/daemon-informative-errors-typofix'
* nd/daemon-informative-errors-typofix:
  daemon: be strict at parsing parameters --[no-]informative-errors
2014-01-10 10:32:59 -08:00
Junio C Hamano
666b4c2670 Merge branch 'tm/fetch-prune'
Fetching 'frotz' branch with "git fetch", while having
'frotz/nitfol' remote-tracking branch from an earlier fetch, would
error out, primarily because the command has not been told to
remove anything on our side. In such a case, "git fetch --prune"
can be used to remove 'frotz/nitfol' to make room to fetch and
store 'frotz' remote-tracking branch.

* tm/fetch-prune:
  fetch --prune: Run prune before fetching
  fetch --prune: always print header url
2014-01-10 10:32:50 -08:00
Junio C Hamano
2da5cbd651 Merge branch 'sb/diff-orderfile-config'
Allow "git diff -O<file>" to be configured with a new configuration
variable.

* sb/diff-orderfile-config:
  diff: add diff.orderfile configuration variable
  diff: let "git diff -O" read orderfile from any file and fail properly
  t4056: add new tests for "git diff -O"
2014-01-10 10:32:42 -08:00
Junio C Hamano
f8c2e3f671 Merge branch 'bc/log-decoration'
"git log --decorate" did not handle a tag pointed by another tag
nicely.

* bc/log-decoration:
  log: properly handle decorations with chained tags
2014-01-10 10:32:39 -08:00
Junio C Hamano
c4bccea2d5 Merge branch 'jh/rlimit-nofile-fallback'
When we figure out how many file descriptors to allocate for
keeping packfiles open, a system with non-working getrlimit() could
cause us to die(), but because we make this call only to get a
rough estimate of how many is available and we do not even attempt
to use up all file descriptors available ourselves, it is nicer to
fall back to a reasonable low value rather than dying.

* jh/rlimit-nofile-fallback:
  get_max_fd_limit(): fall back to OPEN_MAX upon getrlimit/sysconf failure
2014-01-10 10:32:28 -08:00
Junio C Hamano
8a334727fc Merge branch 'rt/bfg-ad-in-filter-branch-doc'
* rt/bfg-ad-in-filter-branch-doc:
  docs: add filter-branch notes on The BFG
2014-01-10 10:32:25 -08:00
Junio C Hamano
061614b309 Merge branch 'mh/path-max'
A few places where we relied on a fixed length buffer to hold
pathnames in these two programs have been converted to use strbuf.

* mh/path-max:
  builtin/prune.c: use strbuf to avoid having to worry about PATH_MAX
  prune-packed: use strbuf to avoid having to worry about PATH_MAX
2014-01-10 10:32:21 -08:00
Junio C Hamano
273c54f82c Merge branch 'ap/path-max'
* ap/path-max:
  Prevent buffer overflows when path is too long
2014-01-10 10:32:18 -08:00
Junio C Hamano
b0504a9519 Merge branch 'cc/replace-object-info'
read_sha1_file() that is the workhorse to read the contents given
an object name honoured object replacements, but there is no
corresponding mechanism to sha1_object_info() that is used to
obtain the metainfo (e.g. type & size) about the object, leading
callers to weird inconsistencies.

* cc/replace-object-info:
  replace info: rename 'full' to 'long' and clarify in-code symbols
  Documentation/git-replace: describe --format option
  builtin/replace: unset read_replace_refs
  t6050: add tests for listing with --format
  builtin/replace: teach listing using short, medium or full formats
  sha1_file: perform object replacement in sha1_object_info_extended()
  t6050: show that git cat-file --batch fails with replace objects
  sha1_object_info_extended(): add an "unsigned flags" parameter
  sha1_file.c: add lookup_replace_object_extended() to pass flags
  replace_object: don't check read_replace_refs twice
  rename READ_SHA1_FILE_REPLACE flag to LOOKUP_REPLACE_OBJECT
2014-01-10 10:32:10 -08:00
Junio C Hamano
010d81ae35 Merge branch 'nd/negative-pathspec'
Introduce "negative pathspec" magic, to allow "git log -- . ':!dir'" to
tell us "I am interested in everything but 'dir' directory".

* nd/negative-pathspec:
  pathspec.c: support adding prefix magic to a pathspec with mnemonic magic
  Support pathspec magic :(exclude) and its short form :!
  glossary-content.txt: rephrase magic signature part
2014-01-10 10:31:48 -08:00
John Keeping
bb3f45838b rebase: fix fork-point with zero arguments
When no arguments are specified, $switch_to is empty so we end up
passing the empty string to "git merge-base --fork-point", which causes
an error.  git-rebase carries on at this point, but in fact we have
failed to apply the fork-point operation.

It turns out that the test in t3400 that was meant to test this didn't
actually need the fork-point behaviour, so enhance it to make sure that
the fork-point is applied correctly.  The modified test fails without
the change to git-rebase.sh in this patch.

Reported-by: Andreas Krey <a.krey@gmx.de>
Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-01-09 15:05:26 -08:00
Michael Haggerty
7902fe03f9 shorten_unambiguous_ref(): tighten up pointer arithmetic
As long as we're being pathologically stingy with mallocs, we might as
well do the math right and save 6 (!) bytes.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-01-09 15:02:36 -08:00
Michael Haggerty
4346663a14 gen_scanf_fmt(): delete function and use snprintf() instead
To replace "%.*s" with "%s", all we have to do is use snprintf()
to interpolate "%s" into the pattern.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-01-09 14:56:06 -08:00
Michael Haggerty
84d5633f98 shorten_unambiguous_ref(): introduce a new local variable
When filling the scanf_fmts array, use a separate variable to keep
track of the offset to avoid clobbering total_len (which we will need
in the next commit).

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-01-09 14:52:44 -08:00
Jens Lehmann
bbad9f9314 rm: better document side effects when removing a submodule
The "Submodules" section of the "git rm" documentation mentions what will
happen when a submodule with a gitfile gets removed with newer git. But it
doesn't talk about what happens when the user changes between commits
before and after the removal, which does not remove the submodule from the
work tree like using the rm command did the first time.

Explain what happens and what the user has to do manually to fix that in
the new BUGS section. Also document this behavior in a new test.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-01-07 14:34:06 -08:00
Jens Lehmann
1cbd18300a mv: better document side effects when moving a submodule
The "Submodules" section of the "git mv" documentation mentions what will
happen when a submodule with a gitfile gets moved with newer git. But it
doesn't talk about what happens when the user changes between commits
before and after the move, which does not update the work tree like using
the mv command did the first time.

Explain what happens and what the user has to do manually to fix that in
the new BUGS section. Also document this behavior in a new test.

Reported-by: George Papanikolaou <g3orge.app@gmail.com>
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-01-07 14:33:04 -08:00
Øystein Walle
2a07e4374c stash: handle specifying stashes with $IFS
When trying to pop/apply a stash specified with an argument
containing IFS whitespace, git-stash will throw an error:

    $ git stash pop 'stash@{two hours ago}'
    Too many revisions specified: stash@{two hours ago}

This happens because word splitting is used to count non-option
arguments. Make use of rev-parse's --sq option to quote the arguments
for us to ensure a correct count. Add quotes where necessary.

Also add a test that verifies correct behaviour.

Helped-by: Thomas Rast <tr@thomasrast.ch>
Signed-off-by: Øystein Walle <oystwa@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-01-07 10:51:04 -08:00
Ramkumar Ramachandra
de06c13a94 completion: complete format.coverLetter
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-01-07 09:59:25 -08:00
Brodie Rao
832cf74c07 sha1_name: don't resolve refs when core.warnambiguousrefs is false
When seeing a full 40-hex object name, get_sha1_basic()
unconditionally checks if the string can also be interpreted as a
refname, but the result will not be used unless warn_ambiguous_refs
is in effect.

Omitting this unnecessary ref resolution provides a substantial
performance improvement, especially when passing many hashes to a
command (like "git rev-list --stdin") and core.warnambiguousrefs is
set to false.  The check incurs 6 stat()s for every hash supplied,
which can be costly over NFS.

Signed-off-by: Brodie Rao <brodie@sf.io>
Acked-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-01-07 09:51:56 -08:00
Jonathan Nieder
e54c1f2d25 pager: set LV=-c alongside LESS=FRSX
On systems with lv configured as the preferred pager (i.e.,
DEFAULT_PAGER=lv at build time, or PAGER=lv exported in the
environment) git commands that use color show control codes instead of
color in the pager:

	$ git diff
	^[[1mdiff --git a/.mailfilter b/.mailfilter^[[m
	^[[1mindex aa4f0b2..17e113e 100644^[[m
	^[[1m--- a/.mailfilter^[[m
	^[[1m+++ b/.mailfilter^[[m
	^[[36m@@ -1,11 +1,58 @@^[[m

"less" avoids this problem because git uses the LESS environment
variable to pass the -R option ('output ANSI color escapes in raw
form') by default.  Use the LV environment variable to pass 'lv' the
-c option ('allow ANSI escape sequences for text decoration / color')
to fix it for lv, too.

Noticed when the default value for color.ui flipped to 'auto' in
v1.8.4-rc0~36^2~1 (2013-06-10).

Reported-by: Olaf Meeuwissen <olaf.meeuwissen@avasys.jp>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-01-07 09:23:41 -08:00
Thomas Ackermann
145e073b84 user-manual: improve html and pdf formatting
Use asciidoc style 'article' instead of 'book' and change asciidoc
title level.  This removes blank first page and superfluous "Part I"
page (there is no "Part II") in pdf output. Also pdf size is
decreased by this from 77 to 67 pages.  In html output this removes
unnecessary sub-tocs and chapter numbering.

Signed-off-by: Thomas Ackermann <th.acker@arcor.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-01-06 11:30:17 -08:00
Sebastian Schuberth
c6127fa3e2 builtin/help.c: speed up is_git_command() by checking for builtin commands first
Since 2dce956 is_git_command() is a bit slow as it does file I/O in
the call to list_commands_in_dir(). Avoid the file I/O by adding an
early check for the builtin commands.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-01-06 11:26:31 -08:00
Sebastian Schuberth
a3c5263438 builtin/help.c: call load_command_list() only when it is needed
This avoids list_commands_in_dir() being called when not needed which is
quite slow due to file I/O in order to list matching files in a directory.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-01-06 11:26:10 -08:00
Sebastian Schuberth
3f784a4dcb git.c: consistently use the term "builtin" instead of "internal command"
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-01-06 11:25:50 -08:00
Junio C Hamano
932f7e4769 Merge branch 'maint'
* maint:
  Documentation/gitmodules: Only 'update' and 'url' are required
  l10n: de.po: fix translation of 'prefix'
2014-01-06 10:39:07 -08:00