Commit graph

33299 commits

Author SHA1 Message Date
Junio C Hamano f59bebb78e Merge branch 'maint-1.8.1' into maint-1.8.2
* maint-1.8.1:
  git-config: update doc for --get with multiple values
2013-07-03 15:26:53 -07:00
John Keeping 62e91efafd git-config: update doc for --get with multiple values
Since commit 00b347d (git-config: do not complain about duplicate
entries, 2012-10-23), "git config --get" does not exit with an error if
there are multiple values for the specified key but instead returns the
last value.  Update the documentation to reflect this.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-03 11:48:15 -07:00
Junio C Hamano 94d75d1ed5 get_short_sha1(): correctly disambiguate type-limited abbreviation
One test in t1512 that expects a failure incorrectly passed.  The
test prepares a commit whose object name begins with ten "0"s, and
also prepares a tag that points at the commit.  The object name of
the tag also begins with ten "0"s.  There is no other commit-ish
object in the repository whose name begins with such a prefix.

Ideally, in such a repository:

    $ git rev-parse --verify 0000000000^{commit}

should yield that commit.  If 0000000000 is taken as the commit
0000000000e4f, peeling it to a commmit yields that commit itself,
and if 0000000000 is taken as the tag 0000000000f8f, peeling it to a
commit also yields the same commit, so in that twisted sense, the
extended SHA-1 expression 0000000000^{commit} is unambigous.  The
test that expects a failure is to check the above command.

The reason the test expects a failure is that we did not implement
such a "unification" of two candidate objects.  What we did (or at
least, meant to) implement was to recognise that a commit-ish is
required to expand 0000000000, and notice that there are two succh
commit-ish, and diagnose the request as ambiguous.

However, there was a bug in the logic to check the candidate
objects.  When the code saw 0000000000f8f (a tag) that shared the
shortened prefix (ten "0"s), it tried to make sure that the tag is a
commit-ish by looking at the tag object.  Because it incorrectly
used lookup_object() when the tag has not been parsed, however, we
incorrectly declared that the tag is _not_ a commit-ish, leaving the
sole commit in the repository, 0000000000e4f, that has the required
prefix as "unique match", causing the test to pass when it shouldn't.

This fixes the logic to inspect the type of the object a tag refers
to, to make the test that is expected to fail correctly fail.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-01 21:54:45 -07:00
Junio C Hamano 2c57f7c9a2 t1512: correct leftover constants from earlier edition
The earliest iteration of this test script used a magic string
110282 as the common prefix for ambiguous object names, but the
final edition switched the common prefix to 0000000000 (10 "0"s).

Unfortunately, instances of the original prefix were left in the
comments and a few tests.  Replace them with the correct constants.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-01 21:54:27 -07:00
Andrew Pimlott f66d000b0d t7500: fix flipped actual/expect
Signed-off-by: Andrew Pimlott <andrew@pimlott.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-01 09:53:00 -07:00
Andrew Pimlott 296fa99334 lib-rebase: document exec_ in FAKE_LINES
Signed-off-by: Andrew Pimlott <andrew@pimlott.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-01 09:52:25 -07:00
Junio C Hamano 43d11f4492 Start preparing for 1.8.3.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-30 15:36:03 -07:00
Junio C Hamano c6c4250eb6 Merge branch 'fc/macos-x-clipped-write' into maint
Mac OS X does not like to write(2) more than INT_MAX number of
bytes; work it around by chopping write(2) into smaller pieces.

* fc/macos-x-clipped-write:
  compate/clipped-write.c: large write(2) fails on Mac OS X/XNU
2013-06-30 15:33:40 -07:00
Junio C Hamano 91863750cd Merge branch 'da/darwin' into maint
Newer MacOS X encourages the programs to compile and link with their
CommonCrypto, not with OpenSSL.

* da/darwin:
  imap-send: eliminate HMAC deprecation warnings on Mac OS X
  cache.h: eliminate SHA-1 deprecation warnings on Mac OS X
  Makefile: add support for Apple CommonCrypto facility
  Makefile: fix default regex settings on Darwin
2013-06-30 15:33:14 -07:00
Ramkumar Ramachandra 5a87e92232 check-ignore doc: fix broken link to ls-files page
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-30 12:34:14 -07:00
SZEDER Gábor 5155c7f37a test: spell 'ls-files --delete' option correctly in test descriptions
The option is spelled '--deleted'.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-30 12:31:26 -07:00
Junio C Hamano 3a461832c5 Git 1.8.3.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-28 14:56:30 -07:00
Stefano Lattarini 94b540479a configure: fix option help message for --disable-pthreads
The configure option to disable threading is '--disable-pthreads',
not '--without-pthreads'.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-28 10:49:26 -07:00
Junio C Hamano 6653aa9ecd Merge branch 'nd/clone-connectivity-shortcut' (early part) into maint
Cloning with "git clone --depth N" while fetch.fsckobjects (or
transfer.fsckobjects) is set to true did not tell the cut-off points
of the shallow history to the process that validates the objects and
the history received, causing the validation to fail.

* 'nd/clone-connectivity-shortcut' (early part):
  fetch-pack: prepare updated shallow file before fetching the pack
  clone: let the user know when check_everything_connected is run
2013-06-28 10:00:00 -07:00
Junio C Hamano e2652c0bcf Start preparing for 1.8.3.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-27 14:48:14 -07:00
Junio C Hamano 88f90f8286 Merge branch 'ks/difftool-dir-diff-copy-fix' into maint
* ks/difftool-dir-diff-copy-fix:
  difftool --dir-diff: allow changing any clean working tree file
2013-06-27 14:38:23 -07:00
Junio C Hamano 6be17ec582 Merge branch 'rr/push-head' into maint
* rr/push-head:
  push: make push.default = current use resolved HEAD
  push: fail early with detached HEAD and current
  push: factor out the detached HEAD error message
2013-06-27 14:38:17 -07:00
Junio C Hamano c9cae1e28a Merge branch 'fc/show-branch-in-rebase-am' into maint
* fc/show-branch-in-rebase-am:
  prompt: fix for simple rebase
2013-06-27 14:38:16 -07:00
Junio C Hamano f79467ef36 Merge branch 'tg/maint-zsh-svn-remote-prompt' into maint
* tg/maint-zsh-svn-remote-prompt:
  prompt: fix show upstream with svn and zsh
2013-06-27 14:38:14 -07:00
Junio C Hamano fc78791b7c Merge branch 'nd/urls-doc-no-file-hyperlink-fix' into maint
* nd/urls-doc-no-file-hyperlink-fix:
  urls.txt: avoid auto converting to hyperlink
2013-06-27 14:38:12 -07:00
Junio C Hamano 1ec379fff8 Merge branch 'tr/push-no-verify-doc' into maint
* tr/push-no-verify-doc:
  Document push --no-verify
2013-06-27 14:38:09 -07:00
Junio C Hamano ee1a1ddf38 Merge branch 'rs/commit-m-no-edit' into maint
* rs/commit-m-no-edit:
  commit: don't start editor if empty message is given with -m
2013-06-27 14:38:07 -07:00
Junio C Hamano 872f5bfb08 Merge branch 'jc/strbuf-branchname-fix' into maint
* jc/strbuf-branchname-fix:
  strbuf_branchname(): do not double-expand @{-1}~22
2013-06-27 14:38:02 -07:00
Junio C Hamano a0bf40ddc9 Merge branch 'mk/combine-diff-context-horizon-fix' into maint
* mk/combine-diff-context-horizon-fix:
  combine-diff.c: Fix output when changes are exactly 3 lines apart
2013-06-27 14:37:56 -07:00
Junio C Hamano 81de16a5d5 Merge branch 'kb/ancestry-path-threedots' into maint
* kb/ancestry-path-threedots:
  revision.c: treat A...B merge bases as if manually specified
  t6019: demonstrate --ancestry-path A...B breakage
2013-06-27 14:37:52 -07:00
Junio C Hamano 7f3447cce8 Merge branch 'jk/subtree-do-not-push-if-split-fails' into maint
* jk/subtree-do-not-push-if-split-fails:
  contrib/subtree: don't delete remote branches if split fails
2013-06-27 14:37:44 -07:00
Junio C Hamano 0fb2c97c20 Merge branch 'mh/fetch-into-shallow' into maint
* mh/fetch-into-shallow:
  t5500: add test for fetching with an unknown 'shallow'
  upload-pack: ignore 'shallow' lines with unknown obj-ids
2013-06-27 14:37:41 -07:00
Junio C Hamano 11fbc0b1e1 Merge branch 'jh/checkout-auto-tracking' into maint
* jh/checkout-auto-tracking:
  glossary: Update and rephrase the definition of a remote-tracking branch
  branch.c: Validate tracking branches with refspecs instead of refs/remotes/*
  t9114.2: Don't use --track option against "svn-remote"-tracking branches
  t7201.24: Add refspec to keep --track working
  t3200.39: tracking setup should fail if there is no matching refspec.
  checkout: Use remote refspecs when DWIMming tracking branches
  t2024: Show failure to use refspec when DWIMming remote branch names
  t2024: Add tests verifying current DWIM behavior of 'git checkout <branch>'
2013-06-27 14:37:21 -07:00
Ramkumar Ramachandra 5e62cc14c3 column doc: rewrite documentation for column.ui
The configuration option column.ui is very poorly documented, and it is
unclear what the defaults are, and what option can be combined with
what.  Rewrite it by splitting up the options into three sections
clearly showing how COL_ENABLED, COL_LAYOUT_MASK, and COL_DENSE work.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-26 08:51:43 -07:00
W. Trevor King 4b9ced278c user-manual: Update download size for Git and the kernel
They've grown since d19fbc3 (Documentation: add git user's manual,
2007-01-07) when the stats were initially added.  I've rounded
download sizes up to the nearest multiple of ten MiB to decrease the
precision and give a bit of growing room.  Exact sizes:

  $ git clone git://git.kernel.org/pub/scm/git/git.git
  Initialized empty Git repository in /tmp/git/.git/
  remote: Counting objects: 156872, done.
  remote: Compressing objects: 100% (40826/40826), done.
  remote: Total 156872 (delta 115322), reused 155492 (delta 114094)
  Receiving objects: 100% (156872/156872), 37.29 MiB | 7.54 MiB/s, done.
  Resolving deltas: 100% (115322/115322), done.

  $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
  Initialized empty Git repository in /tmp/linux/.git/
  remote: Counting objects: 3057404, done.
  remote: Compressing objects: 100% (474769/474769), done.
  Receiving objects: 100% (3057404/3057404), 634.33 MiB | 27.95 MiB/s, done.
  remote: Total 3057404 (delta 2570385), reused 3040910 (delta 2554408)
  Resolving deltas: 100% (2570385/2570385), done.
  Checking out files: 100% (43012/43012), done.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-23 00:35:50 -07:00
Jeff King 5bdc47eb55 lib-httpd/apache.conf: check version only after mod_version loads
Commit 0442743 introduced an <IfVersion> directive near the
top of the apache config file. However, at that point we
have not yet checked for and loaded the mod_version module.
This means that the directive will behave oddly if
mod_version is dynamically loaded, failing to match when it
should.

We can fix this by moving the whole block below the
LoadModule directive for mod_version.

Reported-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-21 13:58:06 -07:00
Yaakov Selkowitz cc2f6b6865 web--browse: support /usr/bin/cygstart on Cygwin
While both GUI and console Cygwin browsers do exist, anecdotal evidence
suggests most users rely on their native Windows browser.  cygstart,
which is a long-standing part of the base Cygwin installation, will
cause the page to be opened in the default Windows browser (the one
registered to open .html files).

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-21 09:05:15 -07:00
Ramkumar Ramachandra c0add3073a completion: complete diff --word-diff
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-21 08:52:16 -07:00
Thomas Rast 212eb96a96 apply: carefully strdup a possibly-NULL name
2901bbe (apply: free patch->{def,old,new}_name fields, 2012-03-21)
cleaned up the memory management of filenames in the patches, but
forgot that find_name_traditional() can return NULL as a way of saying
"I couldn't find a name".

That NULL unfortunately gets passed into xstrdup() next, resulting in
a segfault.  Use null_strdup() so as to safely propagate the null,
which will let us emit the correct error message.

Reported-by: DevHC on #git
Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-21 08:36:07 -07:00
Thomas Rast b4dc085a8d pull: merge into unborn by fast-forwarding from empty tree
The logic for pulling into an unborn branch was originally
designed to be used on a newly-initialized repository
(d09e79c, git-pull: allow pulling into an empty repository,
2006-11-16).  It thus did not initially deal with
uncommitted changes in the unborn branch.  The case of an
_unstaged_ untracked file was fixed by 4b3ffe5 (pull: do not
clobber untracked files on initial pull, 2011-03-25).
However, it still clobbered existing staged files, both when
the file exists in the merged commit (it will be
overwritten), and when it does not (it will be deleted).

We fix this by doing a two-way merge, where the "current"
side of the merge is an empty tree, and the "target" side is
HEAD (already updated to FETCH_HEAD at this point).  This
amounts to claiming that all work in the index was done vs.
an empty tree, and thus all content of the index is
precious.

Note that this use of read-tree just gives us protection
against overwriting index and working tree changes. It will
not actually result in a 3-way merge conflict in the index.
This is fine, as this is a rare situation, and the conflict
would not be interesting anyway (it must, by definition, be
an add/add conflict with the whole content conflicting). And
it makes it simpler for the user to recover, as they have no
HEAD to "git reset" back to.

Reported-by: Stefan Schüßler <mail@stefanschuessler.de>
Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-20 15:51:35 -07:00
Jeff King 9f48f2bd9a pull: update unborn branch tip after index
When commit d09e79c taught git to pull into an unborn
branch, it first updated the unborn branch to point at the
pulled commit, and then used read-tree to update the index
and working tree. That ordering made sense, since any
failure of the latter step would be due to filesystem
errors, and one could then recover with "git reset --hard".

Later, commit 4b3ffe5 added extra safety for existing files
in the working tree by asking read-tree to bail out when it
would overwrite such a file. This error mode is much less
"your pull failed due to random errors" and more like "we
reject this pull because it would lose data". In that case,
it makes sense not to update the HEAD ref, just as a regular
rejected merge would do.

This patch reverses the order of the update-ref and
read-tree calls, so that we do not touch the HEAD ref at all if a
merge is rejected. This also means that we would not update
HEAD in case of a transient filesystem error, but those are
presumably less rare (and one can still recover by repeating
the pull, or by accessing FETCH_HEAD directly).

While we're reorganizing the code, we can drop the "exit 1"
from the end of our command chain. We exit immediately
either way, and just calling exit without an argument will
use the exit code from the last command.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-20 15:51:25 -07:00
Torsten Bögershausen bed9470489 t7400: test of UTF-8 submodule names pass under Mac OS
submodules with names using UTF-8 need core.precomposeunicode true
under Mac OS X, set it in the test case.

Improve the portability:

  - Not all shells on all OS may understand literal UTF-8 strings.
  - Use a help variable filled by printf, as we do it in e.g. t0050.

"strange names" can be called UTF-8, rephrase the heading.

While at it, unbreak &&-chain in the test, and use test_config.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-20 12:00:57 -07:00
Michael S. Tsirkin 4cb46bddeb send-email: sanitize author when writing From line
sender is now sanitized, but we didn't sanitize author when checking
whether From: line is needed in the message body.

As a result git started writing duplicate From: lines when author
matched sender and has utf8 characters.

Reported-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-20 11:27:03 -07:00
Michael S. Tsirkin f07075c297 send-email: add test for duplicate utf8 name
Verify that author name is not duplicated if it matches sender, even
if it is in utf8 (the test expects a failure that will be fixed in
the next patch).

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-20 11:25:46 -07:00
Veres Lajos f7e604ed39 random typofixes (committed missing a 't', successful missing an 's')
Signed-off-by: Veres Lajos <vlajos@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-19 11:31:33 -07:00
Brandon Casey a94cf2cb7e http.c: don't rewrite the user:passwd string multiple times
Curl older than 7.17 (RHEL 4.X provides 7.12 and RHEL 5.X provides
7.15) requires that we manage any strings that we pass to it as
pointers.  So, we really shouldn't be modifying this strbuf after we
have passed it to curl.

Our interaction with curl is currently safe (before or after this
patch) since the pointer that is passed to curl is never invalidated;
it is repeatedly rewritten with the same sequence of characters but
the strbuf functions never need to allocate a larger string, so the
same memory buffer is reused.

This "guarantee" of safety is somewhat subtle and could be overlooked
by someone who may want to add a more complex handling of the username
and password.  So, let's stop modifying this strbuf after we have
passed it to curl, but also leave a note to describe the assumptions
that have been made about username/password lifetime and to draw
attention to the code.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-19 10:00:26 -07:00
Matthieu Moy 70495b556f Documentation/git-push.txt: explain better cases where --force is dangerous
The behavior of "git push --force" is rather clear when it updates only
one remote ref, but running it when pushing several branches can really
be dangerous. Warn the users a bit more and give them the alternative to
push only one branch.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-18 07:35:48 -07:00
Jeff King 296f0b3ea9 t/lib-httpd/apache.conf: configure an MPM module for apache 2.4
Versions of Apache before 2.4 always had a "MultiProcessing
Module" (MPM) statically built in, which manages the worker
threads/processes. We do not care which one, as it is
largely a performance issue, and we put only a light load on
the server during our testing.

As of Apache 2.4, the MPM module is loadable just like any
other module, but exactly one such module must be loaded. On
a system where the MPMs are compiled dynamically (e.g.,
Debian unstable), this means that our test Apache server
will not start unless we provide the appropriate
configuration.

Unfortunately, we do not actually know which MPM modules are
available or appropriate for the system on which the tests
are running. This patch picks the "prefork" module, as it
is likely to be available on all Unix-like systems.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14 10:29:04 -07:00
Jeff King bb3f7ccadb t/lib-httpd/apache.conf: load compat access module in apache 2.4
In apache 2.4, the "Order" directive has gone away in favor
of a new system in mod_authz_host. However, since we want
our config file to remain compatible across multiple Apache
versions, we can use mod_access_compat to keep using the
older style.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14 10:29:01 -07:00
Jeff King a8adcc4730 t/lib-httpd/apache.conf: load extra auth modules in apache 2.4
In apache 2.4, the "Auth*" and "Require" directives have
moved into the authn_core and authz_core modules,
respectively.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14 10:28:16 -07:00
Jeff King 0442743810 t/lib-httpd/apache.conf: do not use LockFile in apache >= 2.4
The LockFile directive from earlier versions of apache has
been replaced by the Mutex directive. The latter seems to
give sane defaults and does not need any specific
customization, so we can get away with just adding a version
check to the use of LockFile.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14 10:27:54 -07:00
Fredrik Gustafsson 74671241fd handle multibyte characters in name
Many "git submodule" operations do not work on a submodule at a path whose
name is not in ASCII.

This is because "git ls-files" is used to find which paths are bound to
submodules to the current working tree, and the output is C-quoted by default
for non ASCII pathnames.

Tell "git ls-files" to not C-quote its output, which is easier than unwrapping
C-quote ourselves.

Signed-off-by: Fredrik Gustafsson <iveqy@iveqy.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-14 08:04:32 -07:00
René Scharfe 0b437a18bd use logical OR (||) instead of binary OR (|) in logical context
The compiler can short-circuit the evaluation of conditions strung
together with logical OR operators instead of computing the resulting
bitmask with binary ORs.  More importantly, this patch makes the
intent of the changed code clearer, because the logical context (as
opposed to binary context) becomes immediately obvious.

While we're at it, simplify the check for patch->is_rename in
builtin/apply.c a bit; it can only be 0 or 1, so we don't need a
comparison operator.

Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-13 14:47:07 -07:00
Junio C Hamano f2b4626d9e Merge branch 'maint-1.8.2' into maint
* maint-1.8.2:
  t0070 "mktemp to unwritable directory" needs SANITY
  pre-push.sample: Make the script executable
2013-06-11 14:24:56 -07:00
Torsten Bögershausen b3b8ceb48b t0070 "mktemp to unwritable directory" needs SANITY
Use the SANITY prerequisite when testing if a temp file can
be created in a read only directory.
Skip the test under CYGWIN, or skip it under Unix/Linux when
it is run as root.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-11 14:23:31 -07:00