Commit graph

35342 commits

Author SHA1 Message Date
Junio C Hamano ad70448576 Merge branch 'cc/starts-n-ends-with'
Remove a few duplicate implementations of prefix/suffix comparison
functions, and rename them to starts_with and ends_with.

* cc/starts-n-ends-with:
  replace {pre,suf}fixcmp() with {starts,ends}_with()
  strbuf: introduce starts_with() and ends_with()
  builtin/remote: remove postfixcmp() and use suffixcmp() instead
  environment: normalize use of prefixcmp() by removing " != 0"
2013-12-17 12:02:44 -08:00
Junio C Hamano 14a9c5f261 Merge branch 'jl/commit-v-strip-marker'
"git commit -v" appends the patch to the log message before
editing, and then removes the patch when the editor returned
control. However, the patch was not stripped correctly when the
first modified path was a submodule.

* jl/commit-v-strip-marker:
  commit -v: strip diffs and submodule shortlogs from the commit message
2013-12-17 11:47:18 -08:00
Junio C Hamano 433a30d0ba Merge branch 'tr/send-email-ssl'
SSL-related options were not passed correctly to underlying socket
layer in "git send-email".

* tr/send-email-ssl:
  send-email: set SSL options through IO::Socket::SSL::set_client_defaults
  send-email: --smtp-ssl-cert-path takes an argument
  send-email: pass Debug to Net::SMTP::SSL::new
2013-12-17 11:47:12 -08:00
Junio C Hamano 7dc8a65c86 Merge branch 'nd/gettext-vsnprintf'
* nd/gettext-vsnprintf:
  gettext.c: detect the vsnprintf bug at runtime
2013-12-17 11:47:10 -08:00
Junio C Hamano fb230b3523 Merge branch 'mm/mv-file-to-no-such-dir-with-slash'
* mm/mv-file-to-no-such-dir-with-slash:
  mv: let 'git mv file no-such-dir/' error out
2013-12-17 11:47:08 -08:00
Junio C Hamano 053fbe672c Merge branch 'nd/remove-opt-boolean'
* nd/remove-opt-boolean:
  parse-options: remove OPT_BOOLEAN
2013-12-17 11:47:05 -08:00
Junio C Hamano 0067272999 Merge branch 'bc/doc-merge-no-op-revert'
* bc/doc-merge-no-op-revert:
  Documentation: document pitfalls with 3-way merge
2013-12-17 11:47:01 -08:00
Junio C Hamano 4d1826d1d9 Merge branch 'fc/trivial'
* fc/trivial:
  remote: fix status with branch...rebase=preserve
  fetch: add missing documentation
  t: trivial whitespace cleanups
  abspath: trivial style fix
2013-12-17 11:46:32 -08:00
Junio C Hamano aa13132d90 Merge branch 'jk/t5000-gzip-simplify'
Test fix.

* jk/t5000-gzip-simplify:
  t5000: simplify gzip prerequisite checks
2013-12-17 11:46:30 -08:00
Junio C Hamano f9633716d0 Merge branch 'kb/doc-exclude-directory-semantics'
* kb/doc-exclude-directory-semantics:
  gitignore.txt: clarify recursive nature of excluded directories
2013-12-17 11:44:19 -08:00
Junio C Hamano d7aced95cd Update draft release notes to 1.9
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-12 14:24:39 -08:00
Junio C Hamano 694a88a309 Merge branch 'jn/scripts-updates'
* jn/scripts-updates:
  remove #!interpreter line from shell libraries
  test: replace shebangs with descriptions in shell libraries
  test: make FILEMODE a lazy prereq
  contrib: remove git-p4import
  mark contributed hooks executable
  mark perl test scripts executable
  mark Windows build scripts executable
2013-12-12 14:22:59 -08:00
Junio C Hamano 72911f8c18 Merge branch 'cn/thin-push-capability'
Allow receive-pack to insist on receiving a fat pack from "git
push" clients.

* cn/thin-push-capability:
  send-pack: don't send a thin pack to a server which doesn't support it
2013-12-12 14:20:32 -08:00
Junio C Hamano 577aed296a Merge branch 'jk/remove-deprecated'
* jk/remove-deprecated:
  stop installing git-tar-tree link
  peek-remote: remove deprecated alias of ls-remote
  lost-found: remove deprecated command
  tar-tree: remove deprecated command
  repo-config: remove deprecated alias for "git config"
2013-12-12 14:18:34 -08:00
Junio C Hamano df5f0ad251 Merge branch 'tr/commit-slab-cleanup'
* tr/commit-slab-cleanup:
  commit-slab: sizeof() the right type in xrealloc
  commit-slab: declare functions "static inline"
  commit-slab: document clear_$slabname()
2013-12-12 14:18:31 -08:00
Junio C Hamano fca26a3430 Merge branch 'rs/doc-submitting-patches'
* rs/doc-submitting-patches:
  SubmittingPatches: document how to handle multiple patches
2013-12-12 14:18:29 -08:00
Junio C Hamano 71fe59f880 Merge branch 'tr/doc-git-cherry'
* tr/doc-git-cherry:
  Documentation: revamp git-cherry(1)
2013-12-12 14:18:24 -08:00
Junio C Hamano feb28ad0a8 Merge branch 'cl/p4-use-diff-tree'
* cl/p4-use-diff-tree:
  git p4: Use git diff-tree instead of format-patch
2013-12-12 14:18:20 -08:00
Junio C Hamano 3497717941 Merge branch 'tr/config-multivalue-lift-max'
* tr/config-multivalue-lift-max:
  config: arbitrary number of matches for --unset and --replace-all
2013-12-12 14:18:09 -08:00
Junio C Hamano e66ef7ae6f Merge branch 'mh/fetch-tags-in-addition-to-normal-refs'
The "--tags" option to "git fetch" used to be literally a synonym to
a "refs/tags/*:refs/tags/*" refspec, which meant that (1) as an
explicit refspec given from the command line, it silenced the lazy
"git fetch" default that is configured, and (2) also as an explicit
refspec given from the command line, it interacted with "--prune"
to remove any tag that the remote we are fetching from does not
have.

This demotes it to an option; with it, we fetch all tags in
addition to what would be fetched without the option, and it does
not interact with the decision "--prune" makes to see what
remote-tracking refs the local has are missing the remote
counterpart.

* mh/fetch-tags-in-addition-to-normal-refs: (23 commits)
  fetch: improve the error messages emitted for conflicting refspecs
  handle_duplicate(): mark error message for translation
  ref_remote_duplicates(): extract a function handle_duplicate()
  ref_remove_duplicates(): simplify loop logic
  t5536: new test of refspec conflicts when fetching
  ref_remove_duplicates(): avoid redundant bisection
  git-fetch.txt: improve description of tag auto-following
  fetch-options.txt: simplify ifdef/ifndef/endif usage
  fetch, remote: properly convey --no-prune options to subprocesses
  builtin/remote.c:update(): use struct argv_array
  builtin/remote.c: reorder function definitions
  query_refspecs(): move some constants out of the loop
  fetch --prune: prune only based on explicit refspecs
  fetch --tags: fetch tags *in addition to* other stuff
  fetch: only opportunistically update references based on command line
  get_expanded_map(): avoid memory leak
  get_expanded_map(): add docstring
  builtin/fetch.c: reorder function definitions
  get_ref_map(): rename local variables
  api-remote.txt: correct section "struct refspec"
  ...
2013-12-12 14:14:10 -08:00
Junio C Hamano 3d252a9c59 Merge git://repo.or.cz/git-gui
* git://repo.or.cz/git-gui:
  git-gui: correct spelling errors in comments
  git-gui: add menu item to launch a bash shell on Windows.
  git-gui: corrected setup of git worktree under cygwin.
  git-gui: right half window is paned
  git-gui: Add gui.displayuntracked option
  git-gui: show the maxrecentrepo config option in the preferences dialog
  git-gui: added gui.maxrecentrepo to extend the number of remembered repos
  git-gui: Improve font rendering on retina macbooks
2013-12-09 14:57:00 -08:00
Junio C Hamano ec418bcfd0 Merge git://ozlabs.org/~paulus/gitk
* git://ozlabs.org/~paulus/gitk:
  gitk: Recognize -L option
  gitk: Support showing the gathered inline diffs
  gitk: Split out diff part in $commitinfo
  gitk: Refactor per-line part of getblobdiffline and its support
  gitk: Support -G option from the command line
  gitk: Tag display improvements
2013-12-09 14:55:41 -08:00
Felipe Contreras 0a54f70905 remote: fix status with branch...rebase=preserve
Commit 66713ef (pull: allow pull to preserve merges when rebasing)
didn't include an update so 'git remote status' parses branch.<name>.rebase=preserve
correctly, let's do that.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-09 14:12:24 -08:00
brian m. carlson c566500032 Documentation: document pitfalls with 3-way merge
Oftentimes people will make the same change in two branches, revert the change
in one branch, and then be surprised when a merge reinstitutes that change when
the branches are merged.  Add an explanatory paragraph that explains that this
occurs and the reason why, so people are not surprised.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-09 13:42:40 -08:00
Felipe Contreras 379484b551 fetch: add missing documentation
There's no mention of the 'origin' default, or the fact that the
upstream tracking branch remote is used.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-09 13:24:33 -08:00
Felipe Contreras 70eabce801 t: trivial whitespace cleanups
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-09 13:24:21 -08:00
Felipe Contreras e46c92e4ef abspath: trivial style fix
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-09 13:19:56 -08:00
Nguyễn Thái Ngọc Duy 212c0a6ff2 parse-options: remove OPT_BOOLEAN
After a86a8b9 (sb/parseopt-boolean-removal), the deprecated
OPT_BOOLEAN is not used anywhere except by OPT__* macros. Kill
OPT_BOOLEAN and make OPT__* use OPT_COUNTUP directly instead. This
should stop OPT_BOOLEAN from entering the tree again in new patches.

OPT__DRY_RUN() is converted to use OPT_BOOL though because it does not
make sense to increase the level of dryness. All OPT__DRY_RUN call
sites have been checked and they look safe for OPT_BOOL.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-09 11:24:16 -08:00
Karsten Blees 59856de171 gitignore.txt: clarify recursive nature of excluded directories
Additionally, precedence of negated patterns is exactly as outlined in
the DESCRIPTION section, we don't need to repeat this.

Signed-off-by: Karsten Blees <blees@dcon.de>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-09 10:55:48 -08:00
Thomas Rast 83786fa412 config: arbitrary number of matches for --unset and --replace-all
git-config used a static match array to hold the matches we want to
unset/replace when using --unset or --replace-all.  Use a
variable-sized array instead.

This in particular fixes the symptoms git-svn had when storing large
numbers of svn-remote.*.added-placeholder entries in the config file.

While the tests are rather more paranoid than just --unset and
--replace-all, the other operations already worked.  Indeed git-svn's
usage only breaks the first time *after* creating so many entries,
when it wants to unset and re-add them all.

Reported-by: Jess Hottenstein <jess.hottenstein@gmail.com>
Signed-off-by: Thomas Rast <tr@thomasrast.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-06 11:48:47 -08:00
Junio C Hamano 077f43447c Start 1.9 cycle
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-06 11:20:04 -08:00
Junio C Hamano dd1cec578d Merge branch 'jk/remove-experimental-loose-object-support'
* jk/remove-experimental-loose-object-support:
  drop support for "experimental" loose objects
2013-12-06 11:09:43 -08:00
Junio C Hamano e2bcd4f779 Merge branch 'nd/magic-pathspec'
"git diff -- ':(icase)makefile'" were rejected unnecessarily.
This needs to be merged to 'maint' later.

* nd/magic-pathspec:
  diff: restrict pathspec limitations to diff b/f case only
2013-12-06 11:09:41 -08:00
Junio C Hamano cb6bd5722f Merge branch 'rr/for-each-ref-decoration'
Add a few formatting directives to "git for-each-ref --format=...",
to paint them in color, etc.

* rr/for-each-ref-decoration:
  for-each-ref: avoid color leakage
  for-each-ref: introduce %(color:...) for color
  for-each-ref: introduce %(upstream:track[short])
  for-each-ref: introduce %(HEAD) asterisk marker
  t6300 (for-each-ref): don't hardcode SHA-1 hexes
  t6300 (for-each-ref): clearly demarcate setup
2013-12-06 11:07:21 -08:00
Junio C Hamano 10a36382ac Merge branch 'jc/bundle'
Code clean-up.

* jc/bundle:
  bundle: use argv-array
2013-12-06 11:07:15 -08:00
Junio C Hamano ef63eb55cd Merge branch 'rh/remote-hg-bzr-updates'
Updates to remote-bzr and remote-hg in contrib.

* rh/remote-hg-bzr-updates:
  remote-bzr, remote-hg: fix email address regular expression
  test-hg.sh: help user correlate verbose output with email test
  test-hg.sh: fix duplicate content strings in author tests
  test-hg.sh: avoid obsolete 'test' syntax
  test-hg.sh: eliminate 'local' bashism
  test-bzr.sh, test-hg.sh: prepare for change to push.default=simple
  test-bzr.sh, test-hg.sh: allow running from any dir
  test-lib.sh: convert $TEST_DIRECTORY to an absolute path
2013-12-06 11:06:53 -08:00
Junio C Hamano 128c5d07c5 Merge branch 'jn/perl-lib-extra'
Allow customizing the paths to Perl modules with the new
PERLLIB_EXTRA makefile variable.

* jn/perl-lib-extra:
  Makefile: add PERLLIB_EXTRA variable that adds to default perl path
  Makefile: rebuild perl scripts when perl paths change
2013-12-06 11:05:39 -08:00
Jens Lehmann 1a72cfd7fa commit -v: strip diffs and submodule shortlogs from the commit message
When using the '-v' option of "git commit" the diff added to the commit
message temporarily for editing is stripped off after the user exited the
editor by searching for "\ndiff --git " and truncating the commmit message
there if it is found.

But this approach has two problems:

- when the commit message itself contains a line starting with
  "diff --git" it will be truncated there prematurely; and

- when the "diff.submodule" setting is set to "log", the diff may
  start with "Submodule <hash1>..<hash2>", which will be left in
  the commit message while it shouldn't.

Fix that by introducing a special scissor separator line starting with the
comment character ('#' or the core.commentChar config if set) followed by
two lines describing what it is for. The scissor line - which will not be
translated - is used to reliably detect the start of the diff so it can be
chopped off from the commit message, no matter what the user enters there.

Turn a known test failure fixed by this change into a successful test;
also add one for a diff starting with a submodule log and another one for
proper handling of the comment char.

Reported-by: Ari Pollak <ari@debian.org>
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-05 14:39:11 -08:00
Christian Couder 5955654823 replace {pre,suf}fixcmp() with {starts,ends}_with()
Leaving only the function definitions and declarations so that any
new topic in flight can still make use of the old functions, replace
existing uses of the prefixcmp() and suffixcmp() with new API
functions.

The change can be recreated by mechanically applying this:

    $ git grep -l -e prefixcmp -e suffixcmp -- \*.c |
      grep -v strbuf\\.c |
      xargs perl -pi -e '
        s|!prefixcmp\(|starts_with\(|g;
        s|prefixcmp\(|!starts_with\(|g;
        s|!suffixcmp\(|ends_with\(|g;
        s|suffixcmp\(|!ends_with\(|g;
      '

on the result of preparatory changes in this series.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-05 14:13:21 -08:00
Christian Couder 956623157f strbuf: introduce starts_with() and ends_with()
prefixcmp() and suffixcmp() share the common "cmp" suffix that
typically are used to name functions that can be used for ordering,
but they can't, because they are not antisymmetric:

        prefixcmp("foo", "foobar") < 0
        prefixcmp("foobar", "foo") == 0

We in fact do not use these functions for ordering.  Replace them
with functions that just check for equality.

Add starts_with() and end_with() that will be used to replace
prefixcmp() and suffixcmp(), respectively, as the first step.  These
are named after corresponding functions/methods in programming
languages, like Java, Python and Ruby.

In vcs-svn/fast_export.c, there was already an ends_with() function
that did the same thing. Let's use the new one instead while at it.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-05 14:12:52 -08:00
Christian Couder 3fb5aead29 builtin/remote: remove postfixcmp() and use suffixcmp() instead
Commit 8cc5b290 (git merge -X<option>, 25 Nov 2009) introduced
suffixcmp() with nearly the same implementation as postfixcmp()
that already existed since commit 211c8968 (Make git-remote a
builtin, 29 Feb 2008).

The only difference between the two implementations is that,
when the string is smaller than the suffix, one implementation
returns 1 while the other one returns -1.

But, as postfixcmp() is only used to compare for equality, the
distinction does not matter and does not affect the correctness of
this patch.

As postfixcmp() has always been static in builtin/remote.c
and is used nowhere else, it makes more sense to remove it
and use suffixcmp() instead in builtin/remote.c, rather than
to remove suffixcmp().

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-05 14:12:52 -08:00
Christian Couder a4552ceb8a environment: normalize use of prefixcmp() by removing " != 0"
To be able to automatically convert prefixcmp() to starts_with()
we need first to make sure that prefixcmp() is always used in
the same way.

So let's remove " != 0" after prefixcmp().

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-05 14:12:52 -08:00
Junio C Hamano 15a42a10ec Sync with 1.8.5 2013-12-05 14:11:20 -08:00
Junio C Hamano b00d2440f7 Merge branch 'gj/push-more-verbose-advice' (early part)
* 'gj/push-more-verbose-advice' (early part):
  push: enhance unspecified push default warning
2013-12-05 14:03:32 -08:00
Junio C Hamano 968182a49d Merge branch 'jn/mediawiki-makefile-updates'
Build and installation procedure clean-up.

* jn/mediawiki-makefile-updates:
  git-remote-mediawiki build: handle DESTDIR/INSTLIBDIR with whitespace
  git-remote-mediawiki build: make 'install' command configurable
  git-remote-mediawiki: honor DESTDIR in "make install"
  git-remote-mediawiki: do not remove installed files in "clean" target
2013-12-05 13:00:23 -08:00
Junio C Hamano c83386d14d Merge branch 'jl/submodule-update-retire-orig-flags'
Code clean-up.

* jl/submodule-update-retire-orig-flags:
  submodule update: remove unnecessary orig_flags variable
2013-12-05 13:00:20 -08:00
Junio C Hamano c3dc3827d6 Merge branch 'nd/wt-status-align-i18n'
An attempt to automatically align the names in the "git status"
output, taking the display width of (translated) section labels
into account.

* nd/wt-status-align-i18n:
  wt-status: take the alignment burden off translators
2013-12-05 13:00:17 -08:00
Junio C Hamano c17fa972d3 Merge branch 'sb/sha1-loose-object-info-check-existence'
"git cat-file --batch-check=ok" did not check the existence of the
named object.

* sb/sha1-loose-object-info-check-existence:
  sha1_loose_object_info(): do not return success on missing object
2013-12-05 13:00:12 -08:00
Junio C Hamano 3979580265 Merge branch 'jk/two-way-merge-corner-case-fix'
Fix a rather longstanding corner-case bug in twoway "reset to
there" merge, which is most often seen in "git am --abort".

* jk/two-way-merge-corner-case-fix:
  t1005: add test for "read-tree --reset -u A B"
  t1005: reindent
  unpack-trees: fix "read-tree -u --reset A B" with conflicted index
2013-12-05 12:59:25 -08:00
Junio C Hamano 10167eb251 Merge branch 'jc/ref-excludes'
People often wished a way to tell "git log --branches" (and "git
log --remotes --not --branches") to exclude some local branches
from the expansion of "--branches" (similarly for "--tags", "--all"
and "--glob=<pattern>").  Now they have one.

* jc/ref-excludes:
  rev-parse: introduce --exclude=<glob> to tame wildcards
  rev-list --exclude: export add/clear-ref-exclusion and ref-excluded API
  rev-list --exclude: tests
  document --exclude option
  revision: introduce --exclude=<glob> to tame wildcards
2013-12-05 12:59:09 -08:00