gitweb.git
Merge branch 'nd/clone-connectivity-shortcut'Junio C Hamano Mon, 9 Sep 2013 21:30:01 +0000 (14:30 -0700)

Merge branch 'nd/clone-connectivity-shortcut'

* nd/clone-connectivity-shortcut:
smart http: use the same connectivity check on cloning

Merge branch 'jc/diff-filter-negation'Junio C Hamano Mon, 9 Sep 2013 21:28:35 +0000 (14:28 -0700)

Merge branch 'jc/diff-filter-negation'

Teach "git diff --diff-filter" to express "I do not want to see
these classes of changes" more directly by listing only the
unwanted ones in lowercase (e.g. "--diff-filter=d" will show
everything but deletion) and deprecate "diff-files -q" which did
the same thing as "--diff-filter=d".

* jc/diff-filter-negation:
diff: deprecate -q option to diff-files
diff: allow lowercase letter to specify what change class to exclude
diff: reject unknown change class given to --diff-filter
diff: preparse --diff-filter string argument
diff: factor out match_filter()
diff: pass the whole diff_options to diffcore_apply_filter()

Merge branch 'ms/fetch-prune-configuration'Junio C Hamano Mon, 9 Sep 2013 21:27:11 +0000 (14:27 -0700)

Merge branch 'ms/fetch-prune-configuration'

Allow fetch.prune and remote.*.prune configuration variables to be set,
and "git fetch" to behave as if "--prune" is given.

"git fetch" that honors remote.*.prune is fine, but I wonder if we
should somehow make "git push" aware of it as well. Perhaps
remote.*.prune should not be just a boolean, but a 4-way "none",
"push", "fetch", "both"?

* ms/fetch-prune-configuration:
fetch: make --prune configurable

cherry-pick: allow "-" as abbreviation of '@{-1}'Hiroshige Umino Thu, 5 Sep 2013 14:57:23 +0000 (23:57 +0900)

cherry-pick: allow "-" as abbreviation of '@{-1}'

"-" abbreviation is handy for "cherry-pick" like "checkout" and "merge".

It's also good for uniformity that a "-" stands as
the name of the previous branch where a branch name is
accepted and it could not mean any other things like stdin.

Signed-off-by: Hiroshige Umino <hiroshige88@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

upload-pack: bump keepalive default to 5 secondsJeff King Sun, 8 Sep 2013 09:02:06 +0000 (05:02 -0400)

upload-pack: bump keepalive default to 5 seconds

There is no reason not to turn on keepalives by default.
They take very little bandwidth, and significantly less than
the progress reporting they are replacing. And in the case
that progress reporting is on, we should never need to send
a keepalive anyway, as we will constantly be showing
progress and resetting the keepalive timer.

We do not necessarily know what the client's idea of a
reasonable timeout is, so let's keep this on the low side of
5 seconds. That is high enough that we will always prefer
our normal 1-second progress reports to sending a keepalive
packet, but low enough that no sane client should consider
the connection hung.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

upload-pack: send keepalive packets during pack computationJeff King Sun, 8 Sep 2013 09:01:31 +0000 (05:01 -0400)

upload-pack: send keepalive packets during pack computation

When upload-pack has started pack-objects, there may be a quiet
period while pack-objects prepares the pack (i.e., counting objects
and delta compression). Normally we would see (and send to the
client) progress information, but if "--quiet" is in effect,
pack-objects will produce nothing at all until the pack data is
ready. On a large repository, this can take tens of seconds (or even
minutes if the system is loaded or the repository is badly packed).
Clients or intermediate proxies can sometimes give up in this
situation, assuming that the server or connection has hung.

This patch introduces a "keepalive" option; if upload-pack sees no
data from pack-objects for a certain number of seconds, it will send
an empty sideband data packet to let the other side know that we are
still working on it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-config: always treat --int as 64-bit internallyJeff King Sun, 8 Sep 2013 08:40:02 +0000 (04:40 -0400)

git-config: always treat --int as 64-bit internally

When you run "git config --int", the maximum size of integer
you get depends on how git was compiled, and what it
considers to be an "int".

This is almost useful, because your scripts calling "git
config" will behave similarly to git internally. But relying
on this is dubious; you have to actually know how git treats
each value internally (e.g., int versus unsigned long),
which is not documented and is subject to change. And even
if you know it is "unsigned long", we do not have a
git-config option to match that behavior.

Furthermore, you may simply be asking git to store a value
on your behalf (e.g., configuration for a hook). In that
case, the relevant range check has nothing at all to do with
git, but rather with whatever scripting tools you are using
(and git has no way of knowing what the appropriate range is
there).

Not only is the range check useless, but it is actively
harmful, as there is no way at all for scripts to look
at config variables with large values. For instance, one
cannot reliably get the value of pack.packSizeLimit via
git-config. On an LP64 system, git happily uses a 64-bit
"unsigned long" internally to represent the value, but the
script cannot read any value over 2G.

Ideally, the "--int" option would simply represent an
arbitrarily large integer. For practical purposes, however,
a 64-bit integer is large enough, and is much easier to
implement (and if somebody overflows it, we will still
notice the problem, and not simply return garbage).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config: make numeric parsing errors more clearJeff King Sun, 8 Sep 2013 08:38:22 +0000 (04:38 -0400)

config: make numeric parsing errors more clear

If we try to parse an integer config argument and get a
number outside of the representable range, we die with the
cryptic message: "bad config value for '%s'".

We can improve two things:

1. Show the value that produced the error (e.g., bad
config value '3g' for 'foo.bar').

2. Mention the reason the value was rejected (e.g.,
"invalid unit" versus "out of range").

A few tests need to be updated with the new output, but that
should not be representative of real-world breakage, as
scripts should not be depending on the exact text of our
stderr output, which is subject to i18n anyway.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config: set errno in numeric git_parse_* functionsJeff King Sun, 8 Sep 2013 08:36:42 +0000 (04:36 -0400)

config: set errno in numeric git_parse_* functions

When we are parsing an integer or unsigned long, we use
the strto*max functions, which properly set errno to ERANGE
if we get a large value. However, we also do further range
checks after applying our multiplication factor, but do not
set ERANGE. This means that a caller cannot tell if an error
was caused by ERANGE or if the input was simply not a valid
number.

This patch teaches git_parse_signed and git_parse_unsigned to set
ERANGE for range errors, and EINVAL for other errors, so that the
caller can reliably tell these cases apart.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config: properly range-check integer valuesJeff King Sun, 8 Sep 2013 08:33:08 +0000 (04:33 -0400)

config: properly range-check integer values

When we look at a config value as an integer using the
git_config_int function, we carefully range-check the value
we get and complain if it is out of our range. But the range
we compare to is that of a "long", which we then cast to an
"int" in the function's return value. This means that on
systems where "int" and "long" have different sizes (e.g.,
LP64 systems), we may pass the range check, but then return
nonsense by truncating the value as we cast it to an int.

We can solve this by converting git_parse_long into
git_parse_int, and range-checking the "int" range. Nobody
actually cared that we used a "long" internally, since the
result was truncated anyway. And the only other caller of
git_parse_long is git_config_maybe_bool, which should be
fine to just use int (though we will now forbid out-of-range
nonsense like setting "merge.ff" to "10g" to mean "true",
which is probably a good thing).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config: factor out integer parsing from range checksJeff King Sun, 8 Sep 2013 08:29:27 +0000 (04:29 -0400)

config: factor out integer parsing from range checks

When we are parsing integers for config, we use an intmax_t
(or uintmax_t) internally, and then check against the size
of our result type at the end. We can parameterize the
maximum representable value, which will let us re-use the
parsing code for a variety of range checks.

Unfortunately, we cannot combine the signed and unsigned
parsing functions easily, as we have to rely on the signed
and unsigned C types internally.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

branch.c: Relax unnecessary requirement on upstream... Per Cederqvist Sun, 8 Sep 2013 20:58:15 +0000 (22:58 +0200)

branch.c: Relax unnecessary requirement on upstream's remote ref name

When creating an upstream relationship, we use the configured remotes and
their refspecs to determine the upstream configuration settings
branch.<name>.remote and branch.<name>.merge. However, if the matching
refspec does not have refs/heads/<something> on the remote side, we end
up rejecting the match, and failing the upstream configuration.

It could be argued that when we set up an branch's upstream, we want that
upstream to also be a proper branch in the remote repo. Although this is
typically the common case, there are cases (as demonstrated by the previous
patch in this series) where this requirement prevents a useful upstream
relationship from being formed. Furthermore:

- We have fundamentally no say in how the remote repo have organized its
branches. The remote repo may put branches (or branch-like constructs
that are insteresting for downstreams to track) outside refs/heads/*.

- The user may intentionally want to track a non-branch from a remote
repo, by using a branch and configured upstream in the local repo.

Relaxing the checking to only require a matching remote/refspec allows the
testcase introduced in the previous patch to succeed, and has no negative
effect on the rest of the test suite.

This patch fixes a behavior (arguably a regression) first introduced in
41c21f2 (branch.c: Validate tracking branches with refspecs instead of
refs/remotes/*) on 2013-04-21 (released in >= v1.8.3.2).

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3200: Add test demonstrating minor regression in 41c21f2Johan Herland Sun, 8 Sep 2013 20:58:14 +0000 (22:58 +0200)

t3200: Add test demonstrating minor regression in 41c21f2

In 41c21f2 (branch.c: Validate tracking branches with refspecs instead of
refs/remotes/*), we changed the rules for what is considered a valid tracking
branch (a.k.a. upstream branch). We now use the configured remotes and their
refspecs to determine whether a proposed tracking branch is in fact within
the domain of a remote, and we then use that information to deduce the
upstream configuration (branch.<name>.remote and branch.<name>.merge).

However, with that change, we also check that - in addition to a matching
refspec - the result of mapping the tracking branch through that refspec
(i.e. the corresponding ref name in the remote repo) happens to start with
"refs/heads/". In other words, we require that a tracking branch refers to
a _branch_ in the remote repo.

Now, consider that you are e.g. setting up an automated building/testing
infrastructure for a group of similar "source" repositories. The build/test
infrastructure consists of a central scheduler, and a number of build/test
"slave" machines that perform the actual build/test work. The scheduler
monitors the group of similar repos for changes (e.g. with a periodic
"git fetch"), and triggers builds/tests to be run on one or more slaves.
Graphically the changes flow between the repos like this:

Source #1 -------v ----> Slave #1
/
Source #2 -----> Scheduler -----> Slave #2
\
Source #3 -------^ ----> Slave #3

... ...

The scheduler maintains a single Git repo with each of the source repos set
up as distinct remotes. The slaves also need access to all the changes from
all of the source repos, so they pull from the scheduler repo, but using the
following custom refspec:

remote.origin.fetch = "+refs/remotes/*:refs/remotes/*"

This makes all of the scheduler's remote-tracking branches automatically
available as identical remote-tracking branches in each of the slaves.

Now, consider what happens if a slave tries to create a local branch with
one of the remote-tracking branches as upstream:

git branch local_branch --track refs/remotes/source-1/some_branch

Git now looks at the configured remotes (in this case there is only "origin",
pointing to the scheduler's repo) and sees refs/remotes/source-1/some_branch
matching origin's refspec. Mapping through that refspec we find that the
corresponding remote ref name is "refs/remotes/source-1/some_branch".
However, since this remote ref name does not start with "refs/heads/", we
discard it as a suitable upstream, and the whole command fails.

This patch adds a testcase demonstrating this failure by creating two
source repos ("a" and "b") that are forwarded through a scheduler ("c")
to a slave repo ("d"), that then tries create a local branch with an
upstream. See the next patch in this series for the exciting conclusion
to this story...

Reported-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Refer to branch.<name>.remote/merge when documenting... Johan Herland Sun, 8 Sep 2013 20:58:13 +0000 (22:58 +0200)

Refer to branch.<name>.remote/merge when documenting --track

Make it easier for readers to find the actual config variables that
implement the "upstream" relationship.

Suggested-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3200: Minor fix when preparing for tracking failureJohan Herland Sun, 8 Sep 2013 20:58:12 +0000 (22:58 +0200)

t3200: Minor fix when preparing for tracking failure

We're testing that trying to --track a ref that is not covered by any remote
refspec should fail. For that, we want to have refs/remotes/local/master
present, but we also want the remote.local.fetch refspec to NOT match
refs/remotes/local/master (so that the tracking setup will fail, as intended).
However, when doing "git fetch local" to ensure the existence of
refs/remotes/local/master, we must not already have changed remote.local.fetch
so as to cause refs/remotes/local/master not to be fetched. Therefore, set
remote.local.fetch to refs/heads/*:refs/remotes/local/* BEFORE we fetch, and
then reset it to refs/heads/s:refs/remotes/local/s AFTER we have fetched
(but before we test --track).

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t2024: Fix &&-chaining and a couple of typosJohan Herland Sun, 8 Sep 2013 20:58:11 +0000 (22:58 +0200)

t2024: Fix &&-chaining and a couple of typos

Improved-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

update-ref: support multiple simultaneous updatesBrad King Mon, 9 Sep 2013 13:22:32 +0000 (09:22 -0400)

update-ref: support multiple simultaneous updates

Add a --stdin signature to read update instructions from standard input
and apply multiple ref updates together. Use an input format that
supports any update that could be specified via the command-line,
including object names like "branch:path with space".

Signed-off-by: Brad King <brad.king@kitware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git: run in a directory given with -C optionNazri Ramliy Mon, 9 Sep 2013 13:47:43 +0000 (21:47 +0800)

git: run in a directory given with -C option

This is similar in spirit to "make -C dir ..." and "tar -C dir ...".

It takes more keypresses to invoke git command in a different
directory without leaving the current directory:

1. (cd ~/foo && git status)
git --git-dir=~/foo/.git --work-dir=~/foo status
GIT_DIR=~/foo/.git GIT_WORK_TREE=~/foo git status
2. (cd ../..; git grep foo)
3. for d in d1 d2 d3; do (cd $d && git svn rebase); done

The methods shown above are acceptable for scripting but are too
cumbersome for quick command line invocations.

With this new option, the above can be done with fewer keystrokes:

1. git -C ~/foo status
2. git -C ../.. grep foo
3. for d in d1 d2 d3; do git -C $d svn rebase; done

A new test script is added to verify the behavior of this option with
other path-related options like --git-dir and --work-tree.

Signed-off-by: Nazri Ramliy <ayiehere@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase: fix run_specific_rebase's use of "return" on... Matthieu Moy Mon, 9 Sep 2013 08:53:15 +0000 (10:53 +0200)

rebase: fix run_specific_rebase's use of "return" on FreeBSD

Since a1549e10, git-rebase--am.sh uses the shell's "return" statement, to
mean "return from the current file inclusion", which is POSIXly correct,
but badly interpreted on FreeBSD, which returns from the current
function, hence skips the finish_rebase statement that follows the file
inclusion.

Make the use of "return" portable by using the file inclusion as the last
statement of a function.

Reported-by: Christoph Mallon <christoph.mallon@gmx.de>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Doc: 'replace' merge and non-merge commitsPhilip Oakley Sun, 8 Sep 2013 12:10:44 +0000 (13:10 +0100)

Doc: 'replace' merge and non-merge commits

Merges are often treated as special case objects so tell users that
they are not special here.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git_remote_helpers: remove little used Python libraryJohn Keeping Sat, 7 Sep 2013 16:19:29 +0000 (17:19 +0100)

git_remote_helpers: remove little used Python library

When it was originally added, the git_remote_helpers library was used as
part of the tests of the remote-helper interface, but since commit
fc407f9 (Add new simplified git-remote-testgit, 2012-11-28) a simple
shell script is used for this.

A search on Ohloh [1] indicates that this library isn't used by any
external projects and even the Python remote helpers in contrib/ don't
use this library, so it is only used by its own test suite.

Since this is the only Python library in Git, removing it will make
packaging easier as the Python scripts only need to be installed for one
version of Python, whereas the library should be installed for all
available versions.

[1] http://code.ohloh.net/search?s=%22git_remote_helpers%22

Signed-off-by: John Keeping <john@keeping.me.uk>
Acked-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pull: use $curr_branch_short moreRené Scharfe Sun, 8 Sep 2013 15:21:44 +0000 (17:21 +0200)

pull: use $curr_branch_short more

One of the first things git-pull.sh does is setting $curr_branch to
the target of HEAD and $curr_branch_short to the same but with the
leading "refs/heads/" removed. Simplify the code by using
$curr_branch_short instead of setting $curr_branch to the same
shortened value.

The only other use of $curr_branch in that function doesn't have to
be replaced with $curr_branch_short because it just checks if the
string is empty. That property is the same with or without the prefix
unless HEAD points to "refs/heads/" alone, which is invalid.

Noticed-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-bzr: reuse bzrlib transports when possibleRichard Hansen Sun, 8 Sep 2013 05:47:49 +0000 (01:47 -0400)

remote-bzr: reuse bzrlib transports when possible

Pass a list of open bzrlib.transport.Transport objects to each bzrlib
function that might create a transport. This enables bzrlib to reuse
existing transports when possible, avoiding multiple concurrent
connections to the same remote server.

If the remote server is accessed via ssh, this fixes a couple of
problems:
* If the user does not have keys loaded into an ssh agent, the user
may be prompted for a password multiple times.
* If the user is using OpenSSH and the ControlMaster setting is set
to auto, git-remote-bzr might hang. This is because bzrlib closes
the multiple ssh sessions in an undefined order and might try to
close the master ssh session before the other sessions. The
master ssh process will not exit until the other sessions have
exited, causing a deadlock. (The ssh sessions are closed in an
undefined order because bzrlib relies on the Python garbage
collector to trigger ssh session termination.)

Signed-off-by: Richard Hansen <rhansen@bbn.com>
Acked-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

l10n: de.po: use "das Tag" instead of "der Tag"Ralf Thielow Sun, 8 Sep 2013 14:28:36 +0000 (16:28 +0200)

l10n: de.po: use "das Tag" instead of "der Tag"

Use "das Tag" to avoid confusion with the German word "Tag" (day).

Reported-by: Dirk Heinrichs <dirk.heinrichs@altum.de>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>

Documentation: make AsciiDoc links always point to... Sebastian Schuberth Fri, 6 Sep 2013 20:03:22 +0000 (22:03 +0200)

Documentation: make AsciiDoc links always point to HTML files

AsciiDoc's "link" is supposed to create hyperlinks for HTML output, so
prefer a "link" to point to an HTML file instead of a text file if an HTML
version of the file is being generated. For RelNotes, keep pointing to
text files as no equivalent HTML files are generated.

If appropriate, also update the link description to not contain the linked
file's extension.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

status: add missing blank line after list of "other... Matthieu Moy Fri, 6 Sep 2013 17:43:09 +0000 (19:43 +0200)

status: add missing blank line after list of "other" files

List of files in other sections ("Changes to be committed", ...) end with
a blank line. It is not the case with the "Untracked files" and "Ignored
files" sections. The issue become particularly visible after the #-prefix
removal, as the last line (e.g. "nothing added to commit but untracked
files present") seems mixed with the untracked files.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: don't set status.displayCommentPrefix file-wideMatthieu Moy Fri, 6 Sep 2013 17:43:08 +0000 (19:43 +0200)

tests: don't set status.displayCommentPrefix file-wide

The previous commit set status.displayCommentPrefix file-wide in
t7060-wtstatus.sh, t7508-status.sh and t/t7512-status-help.sh to make the
patch small. However, now that status.displayCommentPrefix is not the
default, it is better to disable it in tests so that the most common
situation is also the most tested.

While we're there, move the "cat > expect << EOF" blocks inside the
tests.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

status: disable display of '#' comment prefix by defaultMatthieu Moy Fri, 6 Sep 2013 17:43:07 +0000 (19:43 +0200)

status: disable display of '#' comment prefix by default

Historically, "git status" needed to prefix each output line with '#' so
that the output could be added as comment to the commit message. This
prefix comment has no real purpose when "git status" is ran from the
command-line, and this may distract users from the real content.

Disable this prefix comment by default, and make it re-activable for
users needing backward compatibility with status.displayCommentPrefix.

Obviously, "git commit" ignores status.displayCommentPrefix and keeps the
comment unconditionnaly when writing to COMMIT_EDITMSG (but not when
writing to stdout for an error message or with --dry-run).

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule summary: ignore --for-status optionMatthieu Moy Fri, 6 Sep 2013 17:43:06 +0000 (19:43 +0200)

submodule summary: ignore --for-status option

The --for-status option was an undocumented option used only by
wt-status.c, which inserted a header and commented out the output. We can
achieve the same result within wt-status.c, without polluting the
submodule command-line options.

This will make it easier to disable the comments from wt-status.c later.

The --for-status is kept so that another topic in flight
(bc/submodule-status-ignored) can continue relying on it, although it is
currently a no-op.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

wt-status: use argv_array APIMatthieu Moy Fri, 6 Sep 2013 17:43:05 +0000 (19:43 +0200)

wt-status: use argv_array API

No behavior change, but two slight code reorganization: argv_array_push
doesn't accept NULL strings, and duplicates its argument hence
summary_limit must be written to before being inserted into argv.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/stripspace.c: fix broken indentationMatthieu Moy Fri, 6 Sep 2013 17:43:04 +0000 (19:43 +0200)

builtin/stripspace.c: fix broken indentation

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t6050-replace: use some long option namesChristian Couder Fri, 6 Sep 2013 05:10:59 +0000 (07:10 +0200)

t6050-replace: use some long option names

So that they are tested a little bit too.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

replace: allow long option namesChristian Couder Fri, 6 Sep 2013 05:10:58 +0000 (07:10 +0200)

replace: allow long option names

It is now standard practice in Git to have both short and long option
names. So let's give a long option name to the git replace options too.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/replace: add Creating Replacement Objects... Christian Couder Fri, 6 Sep 2013 05:10:57 +0000 (07:10 +0200)

Documentation/replace: add Creating Replacement Objects section

There were no hints in the documentation about how to create
replacement objects.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t6050-replace: add test to clean up all the replace... Christian Couder Fri, 6 Sep 2013 05:10:56 +0000 (07:10 +0200)

t6050-replace: add test to clean up all the replace refs

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t6050-replace: test that objects are of the same typeChristian Couder Fri, 6 Sep 2013 05:10:55 +0000 (07:10 +0200)

t6050-replace: test that objects are of the same type

and that the -f option bypasses the type check

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/replace: state that objects must be of... Christian Couder Fri, 6 Sep 2013 05:10:54 +0000 (07:10 +0200)

Documentation/replace: state that objects must be of the same type

A previous patch ensures that both the replaced and the replacement
objects passed to git replace must be of the same type, except if
-f option is used.

While at it state that there is no other restriction on both objects.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

replace: forbid replacing an object with one of a diffe... Christian Couder Fri, 6 Sep 2013 05:10:53 +0000 (07:10 +0200)

replace: forbid replacing an object with one of a different type

Users replacing an object with one of a different type were not
prevented to do so, even if it was obvious, and stated in the doc,
that bad things would result from doing that.

To avoid mistakes, it is better to just forbid that though.

If -f option, which means '--force', is used, we can allow an object
to be replaced with one of a different type, as the user should know
what (s)he is doing.

If one object is replaced with one of a different type, the only way
to keep the history valid is to also replace all the other objects
that point to the replaced object. That's because:

* Annotated tags contain the type of the tagged object.

* The tree/parent lines in commits must be a tree and commits, resp.

* The object types referred to by trees are specified in the 'mode'
field:
100644 and 100755 blob
160000 commit
040000 tree
(these are the only valid modes)

* Blobs don't point at anything.

The doc will be updated in a later patch.

Acked-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-svn: fix termination issues for remote svn connectionsUli Heller Tue, 3 Sep 2013 07:35:29 +0000 (09:35 +0200)

git-svn: fix termination issues for remote svn connections

git-svn used in combination with serf to talk to svn repository
served over HTTPS dumps core on termination.

This is caused by a bug in serf, and the most recent serf release
1.3.1 still exhibits the problem; a fix for the bug exists (see
https://code.google.com/p/serf/source/detail?r=2146).

Until the bug is fixed, work around the issue within the git perl
module Ra.pm by freeing the private copy of the remote access object
on termination, which seems to be sufficient to prevent the error
from happening.

Note: Since subversion-1.8.0 and later do require serf-1.2.1 or
later, this issue typically shows up when upgrading to a recent
version of subversion.

Credits go to Jonathan Lambrechts for proposing a fix to Ra.pm,
Evgeny Kotkov and Ivan Zhakov for fixing the issue in serf and
pointing me to that fix.

Signed-off-by: Uli Heller <uli.heller@daemons-point.com>
Tested-by: Kyle J. McKay <mackyle@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

typofix: cherry is spelled with two arsJunio C Hamano Thu, 5 Sep 2013 21:51:17 +0000 (14:51 -0700)

typofix: cherry is spelled with two ars

Do not say chery; it is spelled cherry.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with maintJunio C Hamano Thu, 5 Sep 2013 21:41:40 +0000 (14:41 -0700)

Sync with maint

* maint:
Documentation/git-merge.txt: fix formatting of example block

Merge branch 'nd/fetch-pack-shallow-fix' into maintJunio C Hamano Thu, 5 Sep 2013 21:40:58 +0000 (14:40 -0700)

Merge branch 'nd/fetch-pack-shallow-fix' into maint

The recent "short-cut clone connectivity check" topic broke a shallow
repository when a fetch operation tries to auto-follow tags.

* nd/fetch-pack-shallow-fix:
fetch-pack: do not remove .git/shallow file when --depth is not specified

Merge branch 'hv/config-from-blob' into maintJunio C Hamano Thu, 5 Sep 2013 21:40:18 +0000 (14:40 -0700)

Merge branch 'hv/config-from-blob' into maint

Compilation fix on platforms with fgetc() and friends defined as
macros.

* hv/config-from-blob:
config: do not use C function names as struct members

Merge branch 'maint-1.8.3' into maintJunio C Hamano Thu, 5 Sep 2013 21:24:59 +0000 (14:24 -0700)

Merge branch 'maint-1.8.3' into maint

* maint-1.8.3:
Documentation/git-merge.txt: fix formatting of example block

Merge branch 'maint-1.8.2' into maint-1.8.3Junio C Hamano Thu, 5 Sep 2013 21:24:52 +0000 (14:24 -0700)

Merge branch 'maint-1.8.2' into maint-1.8.3

* maint-1.8.2:
Documentation/git-merge.txt: fix formatting of example block

add: lift the pathspec magic restriction on "add -p"Nguyễn Thái Ngọc Duy Thu, 5 Sep 2013 03:40:39 +0000 (10:40 +0700)

add: lift the pathspec magic restriction on "add -p"

Since 480ca64 (convert run_add_interactive to use struct pathspec -
2013-07-14), we have unconditionally passed :(prefix)xxx to
add-interactive.perl. It implies that all commands
add-interactive.perl calls must be aware of pathspec magic, or
:(prefix) is barfed. The restriction to :/ only becomes unnecessary.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pathspec: catch prepending :(prefix) on pathspec with... Nguyễn Thái Ngọc Duy Thu, 5 Sep 2013 03:40:38 +0000 (10:40 +0700)

pathspec: catch prepending :(prefix) on pathspec with short magic

:(prefix) is in the long form. Suppose people pass :!foo with '!'
being the short form of magic 'bar', the code will happily turn it to
:(prefix..)!foo, which makes '!' part of the path and no longer a magic.

The correct form must be ':(prefix..,bar)foo', but as so far we
haven't had any magic in short form yet (*), the code to convert from
short form to long one will be inactive anyway. Let's postpone it
until a real short form magic appears.

(*) The short form magic '/' is a special case and won't be caught by
this die(), which is correct. When '/' magic is detected, prefixlen is
set back to 0 and the whole "if (prefixlen..)" block is skipped.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/git-merge.txt: fix formatting of example... Andreas Schwab Thu, 5 Sep 2013 15:12:45 +0000 (17:12 +0200)

Documentation/git-merge.txt: fix formatting of example block

You need at least four dashes in a line to have it recognized as listing
block delimiter by asciidoc.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

typofix: commit is spelled with two emsJunio C Hamano Wed, 4 Sep 2013 22:28:45 +0000 (15:28 -0700)

typofix: commit is spelled with two ems

There are a handful of instances where we say commmit when we mean
commit. Fix them.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

glossary: fix and clarify the definition of 'ref'Richard Hansen Wed, 4 Sep 2013 19:04:34 +0000 (15:04 -0400)

glossary: fix and clarify the definition of 'ref'

Signed-off-by: Richard Hansen <rhansen@bbn.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

revisions.txt: fix and clarify <rev>^{<type>}Richard Hansen Wed, 4 Sep 2013 19:04:33 +0000 (15:04 -0400)

revisions.txt: fix and clarify <rev>^{<type>}

If possible, <rev> will be dereferenced even if it is not a tag type
(e.g., commit dereferenced to a tree).

Signed-off-by: Richard Hansen <rhansen@bbn.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

glossary: more precise definition of tree-ish (a.k... Richard Hansen Wed, 4 Sep 2013 19:04:32 +0000 (15:04 -0400)

glossary: more precise definition of tree-ish (a.k.a. treeish)

A tree-ish isn't a ref. Also, mention dereferencing, and that a
commit dereferences to a tree, to support gitrevisions(7) and
rev-parse's error messages.

Signed-off-by: Richard Hansen <rhansen@bbn.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

use 'commit-ish' instead of 'committish'Richard Hansen Wed, 4 Sep 2013 19:04:31 +0000 (15:04 -0400)

use 'commit-ish' instead of 'committish'

Replace 'committish' in documentation and comments with 'commit-ish'
to match gitglossary(7) and to be consistent with 'tree-ish'.

The only remaining instances of 'committish' are:
* variable, function, and macro names
* "(also committish)" in the definition of commit-ish in
gitglossary[7]

Signed-off-by: Richard Hansen <rhansen@bbn.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

use 'tree-ish' instead of 'treeish'Richard Hansen Wed, 4 Sep 2013 19:04:30 +0000 (15:04 -0400)

use 'tree-ish' instead of 'treeish'

Replace 'treeish' in documentation and comments with 'tree-ish' to
match gitglossary(7).

The only remaining instances of 'treeish' are:
* variable, function, and macro names
* "(also treeish)" in the definition of tree-ish in gitglossary(7)

Signed-off-by: Richard Hansen <rhansen@bbn.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

glossary: define commit-ish (a.k.a. committish)Richard Hansen Wed, 4 Sep 2013 19:04:29 +0000 (15:04 -0400)

glossary: define commit-ish (a.k.a. committish)

Signed-off-by: Richard Hansen <rhansen@bbn.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

glossary: mention 'treeish' as an alternative to 'tree... Richard Hansen Wed, 4 Sep 2013 19:04:28 +0000 (15:04 -0400)

glossary: mention 'treeish' as an alternative to 'tree-ish'

The documentation contains a mix of the two spellings, so include both
in the glossary so that a search for either will lead to the
definition.

Signed-off-by: Richard Hansen <rhansen@bbn.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule: don't print status output with ignore=allBrian M. Carlson Sun, 1 Sep 2013 20:06:49 +0000 (20:06 +0000)

submodule: don't print status output with ignore=all

git status prints information for submodules, but it should ignore the status of
those which have submodule.<name>.ignore set to all. Fix it so that it does
properly ignore those which have that setting either in .git/config or in
.gitmodules.

Not ignored are submodules that are added, deleted, or moved (which is
essentially a combination of the first two) because it is not easily possible to
determine the old path once a move has occurred, nor is it easily possible to
detect which adds and deletions are moves and which are not. This also
preserves the previous behavior of always listing modules which are to be
deleted.

Tests are included which verify that this change has no effect on git submodule
summary without the --for-status option.

Signed-off-by: Brian M. Carlson <sandals@crustytoothpaste.net>
Acked-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pull: allow pull to preserve merges when rebasingStephen Haberman Tue, 13 Aug 2013 03:43:42 +0000 (22:43 -0500)

pull: allow pull to preserve merges when rebasing

If a user is working on master, and has merged in their feature branch, but now
has to "git pull" because master moved, with pull.rebase their feature branch
will be flattened into master.

This is because "git pull" currently does not know about rebase's preserve
merges flag, which would avoid this behavior, as it would instead replay just
the merge commit of the feature branch onto the new master, and not replay each
individual commit in the feature branch.

Add a --rebase=preserve option, which will pass along --preserve-merges to
rebase.

Also add 'preserve' to the allowed values for the pull.rebase config setting.

Signed-off-by: Stephen Haberman <stephen@exigencecorp.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes after merging the first... Junio C Hamano Wed, 4 Sep 2013 19:41:05 +0000 (12:41 -0700)

Update draft release notes after merging the first batch of topics

Merge branch 'sb/parseopt-boolean-removal'Junio C Hamano Wed, 4 Sep 2013 19:39:02 +0000 (12:39 -0700)

Merge branch 'sb/parseopt-boolean-removal'

Convert most uses of OPT_BOOLEAN/OPTION_BOOLEAN that can use
OPT_BOOL/OPTION_BOOLEAN which have much saner semantics, and turn
remaining ones into OPT_SET_INT, OPT_COUNTUP, etc. as necessary.

* sb/parseopt-boolean-removal:
revert: use the OPT_CMDMODE for parsing, reducing code
checkout-index: fix negations of even numbers of -n
config parsing options: allow one flag multiple times
hash-object: replace stdin parsing OPT_BOOLEAN by OPT_COUNTUP
branch, commit, name-rev: ease up boolean conditions
checkout: remove superfluous local variable
log, format-patch: parsing uses OPT__QUIET
Replace deprecated OPT_BOOLEAN by OPT_BOOL
Remove deprecated OPTION_BOOLEAN for parsing arguments

Merge branch 'jc/parseopt-command-modes'Junio C Hamano Wed, 4 Sep 2013 19:37:52 +0000 (12:37 -0700)

Merge branch 'jc/parseopt-command-modes'

Many commands use --dashed-option as a operation mode selector
(e.g. "git tag --delete") that the user can use at most one
(e.g. "git tag --delete --verify" is a nonsense) and you cannot
negate (e.g. "git tag --no-delete" is a nonsense). Make it easier
for users of parse_options() to enforce these restrictions.

* jc/parseopt-command-modes:
tag: use OPT_CMDMODE
parse-options: add OPT_CMDMODE()

Merge branch 'jl/some-submodule-config-are-not-boolean'Junio C Hamano Wed, 4 Sep 2013 19:36:51 +0000 (12:36 -0700)

Merge branch 'jl/some-submodule-config-are-not-boolean'

* jl/some-submodule-config-are-not-boolean:
avoid segfault on submodule.*.path set to an empty "true"

Merge branch 'sg/bash-prompt-lf-in-cwd-test'Junio C Hamano Wed, 4 Sep 2013 19:36:47 +0000 (12:36 -0700)

Merge branch 'sg/bash-prompt-lf-in-cwd-test'

* sg/bash-prompt-lf-in-cwd-test:
bash prompt: test the prompt with newline in repository path

Merge branch 'sb/diff-delta-remove-needless-comparison'Junio C Hamano Wed, 4 Sep 2013 19:36:44 +0000 (12:36 -0700)

Merge branch 'sb/diff-delta-remove-needless-comparison'

* sb/diff-delta-remove-needless-comparison:
create_delta_index: simplify condition always evaluating to true

Merge branch 'fc/unpack-trees-leakfix'Junio C Hamano Wed, 4 Sep 2013 19:36:41 +0000 (12:36 -0700)

Merge branch 'fc/unpack-trees-leakfix'

* fc/unpack-trees-leakfix:
unpack-trees: plug a memory leak

Merge branch 'aj/p4-symlink-lose-nl'Junio C Hamano Wed, 4 Sep 2013 19:36:37 +0000 (12:36 -0700)

Merge branch 'aj/p4-symlink-lose-nl'

* aj/p4-symlink-lose-nl:
git-p4: Fix occasional truncation of symlink contents.

Merge branch 'fc/remote-hg-shared-setup'Junio C Hamano Wed, 4 Sep 2013 19:36:32 +0000 (12:36 -0700)

Merge branch 'fc/remote-hg-shared-setup'

* fc/remote-hg-shared-setup:
remote-hg: add shared repo upgrade
remote-hg: ensure shared repo is initialized

Merge branch 'sb/misc-cleanup'Junio C Hamano Wed, 4 Sep 2013 19:36:30 +0000 (12:36 -0700)

Merge branch 'sb/misc-cleanup'

* sb/misc-cleanup:
rm: remove unneeded null pointer check
diff: fix a possible null pointer dereference
diff: remove ternary operator evaluating always to true

Merge branch 'nd/gc-lock-against-each-other'Junio C Hamano Wed, 4 Sep 2013 19:35:34 +0000 (12:35 -0700)

Merge branch 'nd/gc-lock-against-each-other'

* nd/gc-lock-against-each-other:
gc: reject if another gc is running, unless --force is given

Merge branch 'ap/remote-hg-tilde-is-home-directory'Junio C Hamano Wed, 4 Sep 2013 19:33:57 +0000 (12:33 -0700)

Merge branch 'ap/remote-hg-tilde-is-home-directory'

* ap/remote-hg-tilde-is-home-directory:
remote-hg: fix path when cloning with tilde expansion

Merge branch 'mm/no-shell-escape-in-die-message'Junio C Hamano Wed, 4 Sep 2013 19:32:15 +0000 (12:32 -0700)

Merge branch 'mm/no-shell-escape-in-die-message'

Fixes a minor bug in "git rebase -i" (there could be others, as the
root cause is pretty generic) where the code feeds a random, data
dependeant string to 'echo' and expects it to come out literally.

* mm/no-shell-escape-in-die-message:
die_with_status: use "printf '%s\n'", not "echo"

Merge branch 'tr/fd-gotcha-fixes'Junio C Hamano Wed, 4 Sep 2013 19:32:11 +0000 (12:32 -0700)

Merge branch 'tr/fd-gotcha-fixes'

Finishing touches to an earlier fix already in 'master'.

* tr/fd-gotcha-fixes:
t0070: test that git_mkstemps correctly checks return value of open()

Merge branch 'bc/unuse-packfile'Junio C Hamano Wed, 4 Sep 2013 19:30:21 +0000 (12:30 -0700)

Merge branch 'bc/unuse-packfile'

Handle memory pressure and file descriptor pressure separately when
deciding to release pack windows to honor resource limits.

* bc/unuse-packfile:
Don't close pack fd when free'ing pack windows
sha1_file: introduce close_one_pack() to close packs on fd pressure

Merge branch 'da/darwin'Junio C Hamano Wed, 4 Sep 2013 19:28:15 +0000 (12:28 -0700)

Merge branch 'da/darwin'

* da/darwin:
OS X: Fix redeclaration of die warning
Makefile: Fix APPLE_COMMON_CRYPTO with BLK_SHA1
imap-send: use Apple's Security framework for base64 encoding

Merge branch 'nd/sq-quote-buf'Junio C Hamano Wed, 4 Sep 2013 19:28:12 +0000 (12:28 -0700)

Merge branch 'nd/sq-quote-buf'

Code simplification as a preparatory step to something larger.

* nd/sq-quote-buf:
quote: remove sq_quote_print()
tar-tree: remove dependency on sq_quote_print()
for-each-ref, quote: convert *_quote_print -> *_quote_buf

Merge branch 'rr/feed-real-path-to-editor'Junio C Hamano Wed, 4 Sep 2013 19:26:54 +0000 (12:26 -0700)

Merge branch 'rr/feed-real-path-to-editor'

* rr/feed-real-path-to-editor:
editor: use canonicalized absolute path

Merge branch 'jk/fast-import-empty-ls'Junio C Hamano Wed, 4 Sep 2013 19:23:35 +0000 (12:23 -0700)

Merge branch 'jk/fast-import-empty-ls'

* jk/fast-import-empty-ls:
fast-import: allow moving the root tree
fast-import: allow ls or filecopy of the root tree
fast-import: set valid mode on root tree in "ls"
t9300: document fast-import empty path issues

Merge branch 'km/svn-1.8-serf-only'Junio C Hamano Wed, 4 Sep 2013 19:23:33 +0000 (12:23 -0700)

Merge branch 'km/svn-1.8-serf-only'

Subversion 1.8.0 that was recently released breaks older subversion
clients coming over http/https in various ways.

* km/svn-1.8-serf-only:
Git.pm: revert _temp_cache use of temp_is_locked
git-svn: allow git-svn fetching to work using serf
Git.pm: add new temp_is_locked function

Merge branch 'jc/check-x-z'Junio C Hamano Wed, 4 Sep 2013 19:23:24 +0000 (12:23 -0700)

Merge branch 'jc/check-x-z'

"git check-ignore -z" applied the NUL termination to both its input
(with --stdin) and its output, but "git check-attr -z" ignored the
option on the output side.

This is potentially a backward incompatible fix. Let's see if
anybody screams before deciding if we want to do anything to help
existing users (there may be none).

* jc/check-x-z:
check-attr -z: a single -z should apply to both input and output
check-ignore -z: a single -z should apply to both input and output
check-attr: the name of the character is NUL, not NULL
check-ignore: the name of the character is NUL, not NULL

refs: add update_refs for multiple simultaneous updatesBrad King Wed, 4 Sep 2013 15:22:43 +0000 (11:22 -0400)

refs: add update_refs for multiple simultaneous updates

Add 'struct ref_update' to encode the information needed to update or
delete a ref (name, new sha1, optional old sha1, no-deref flag). Add
function 'update_refs' accepting an array of updates to perform. First
sort the input array to order locks consistently everywhere and reject
multiple updates to the same ref. Then acquire locks on all refs with
verified old values. Then update or delete all refs accordingly. Fail
if any one lock cannot be obtained or any one old value does not match.

Though the refs themselves cannot be modified together in a single
atomic transaction, this function does enable some useful semantics.
For example, a caller may create a new branch starting from the head of
another branch and rewind the original branch at the same time. This
transfers ownership of commits between branches without risk of losing
commits added to the original branch by a concurrent process, or risk of
a concurrent process creating the new branch first.

Signed-off-by: Brad King <brad.king@kitware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: add function to repack without multiple refsBrad King Wed, 4 Sep 2013 15:22:42 +0000 (11:22 -0400)

refs: add function to repack without multiple refs

Generalize repack_without_ref as repack_without_refs to support a list
of refs and implement the former in terms of the latter.

Signed-off-by: Brad King <brad.king@kitware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: factor delete_ref loose ref step into a helperBrad King Wed, 4 Sep 2013 15:22:41 +0000 (11:22 -0400)

refs: factor delete_ref loose ref step into a helper

Factor loose ref deletion into helper function delete_ref_loose to allow
later use elsewhere.

Signed-off-by: Brad King <brad.king@kitware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: factor update_ref steps into helpersBrad King Wed, 4 Sep 2013 15:22:40 +0000 (11:22 -0400)

refs: factor update_ref steps into helpers

Factor the lock and write steps and error handling into helper functions
update_ref_lock and update_ref_write to allow later use elsewhere.
Expose lock_any_ref_for_update's type_p to update_ref_lock callers.

While at it, drop "static" from the local "lock" variable as it is not
necessary to keep across invocations.

Signed-off-by: Brad King <brad.king@kitware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5308: check that index-pack --strict detects duplicate... Jeff King Wed, 4 Sep 2013 09:01:53 +0000 (05:01 -0400)

t5308: check that index-pack --strict detects duplicate objects

Commit 68be2fea (receive-pack, fetch-pack: reject bogus pack that
records objects twice, 2011-11-16) taught index-pack to notice and
reject duplicate objects if --strict is given (which it is for
incoming packs, if transfer.fsckObjects is set). However, it never
tested the code, because we did not have an easy way of generating
such a bogus pack.

Now that we have test infrastructure to handle this, let's confirm
that it works.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

add--interactive: fix external command invocation on... Johannes Sixt Wed, 4 Sep 2013 07:24:47 +0000 (09:24 +0200)

add--interactive: fix external command invocation on Windows

Back in 21e9757e (Hack git-add--interactive to make it work with
ActiveState Perl, 2007-08-01), the invocation of external commands was
changed to use qx{} on Windows. The rationale was that the command
interpreter on Windows is not a POSIX shell, but rather Windows's CMD.
That patch was wrong to include 'msys' in the check whether to use qx{}
or not: 'msys' identifies MSYS perl as shipped with Git for Windows,
which does not need the special treatment; qx{} should be used only with
ActiveState perl, which is identified by 'MSWin32'.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git p4: implement view spec wildcards with "p4 where"Kazuki Saitoh Fri, 30 Aug 2013 10:02:06 +0000 (19:02 +0900)

git p4: implement view spec wildcards with "p4 where"

"git p4" does not support many of the view wildcards, such as * and
%%n. It only knows the common ... mapping, and exclusions.

Redo the entire wildcard code around the idea of directly querying
the p4 server for the mapping. For each commit, invoke "p4 where"
with committed file paths as args and use the client mapping to
decide where the file goes in git.

This simplifies a lot of code, and adds support for all wildcards
supported by p4. Downside is that there is probably a 20%-ish
slowdown with this approach.

[pw: redo code and tests]

Signed-off-by: Kazuki Saitoh <ksaitoh560@gmail.com>
Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Tue, 3 Sep 2013 20:58:16 +0000 (13:58 -0700)

Merge branch 'maint'

* maint:
fix shell syntax error in template
l10n: fr.po: hotfix for commit 6b388fc

Merge git://github.com/git-l10n/git-po into maintJunio C Hamano Tue, 3 Sep 2013 20:58:03 +0000 (13:58 -0700)

Merge git://github.com/git-l10n/git-po into maint

* git://github.com/git-l10n/git-po:
l10n: fr.po: hotfix for commit 6b388fc

Merge branch 'maint-1.8.3' into maintJunio C Hamano Tue, 3 Sep 2013 20:54:32 +0000 (13:54 -0700)

Merge branch 'maint-1.8.3' into maint

* maint-1.8.3:
fix shell syntax error in template

Merge branch 'maint-1.8.2' into maint-1.8.3Junio C Hamano Tue, 3 Sep 2013 20:54:26 +0000 (13:54 -0700)

Merge branch 'maint-1.8.2' into maint-1.8.3

* maint-1.8.2:
fix shell syntax error in template

peel_onion: do not assume length of x_type globalsJeff King Tue, 3 Sep 2013 20:27:30 +0000 (16:27 -0400)

peel_onion: do not assume length of x_type globals

When we are parsing "rev^{foo}", we check "foo" against the
various global type strings, like "commit_type",
"tree_type", etc. This is nicely abstracted, but then we
destroy the abstraction completely by using magic numbers
that must match the length of the type strings.

We could avoid these magic numbers by using skip_prefix. But
taking a step back, we can realize that using the
"commit_type" global is not really buying us anything. It is
not ever going to change from being "commit" without causing
severe breakage to existing uses. And even if it did change
for some crazy reason, we would want to evaluate its effects
on the "rev^{}" syntax, anyway.

Let's just switch these to using a custom string literal, as
we do for "rev^{object}". The resulting code is more robust
to changes in the type strings, and is more readable.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

peel_onion(): add support for <rev>^{tag}Richard Hansen Tue, 3 Sep 2013 19:50:16 +0000 (15:50 -0400)

peel_onion(): add support for <rev>^{tag}

Complete the <rev>^{<type>} family of object descriptors by having
<rev>^{tag} dereference <rev> until a tag object is found (or fail if
unable).

At first glance this may not seem very useful, as commits, trees, and
blobs cannot be peeled to a tag, and a tag would just peel to itself.
However, this can be used to ensure that <rev> names a tag object:

$ git rev-parse --verify v1.8.4^{tag}
04f013dc38d7512eadb915eba22efc414f18b869
$ git rev-parse --verify master^{tag}
error: master^{tag}: expected tag type, but the object dereferences to tree type
fatal: Needed a single revision

Users can already ensure that <rev> is a tag object by checking the
output of 'git cat-file -t <rev>', but:
* users may expect <rev>^{tag} to exist given that <rev>^{commit},
<rev>^{tree}, and <rev>^{blob} all exist
* this syntax is more convenient/natural in some circumstances

Signed-off-by: Richard Hansen <rhansen@bbn.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rev-parse test: use standard test functions for setupFelipe Contreras Tue, 3 Sep 2013 17:15:46 +0000 (10:15 -0700)

rev-parse test: use standard test functions for setup

Save the reader from learning specialized t6* setup functions
where familiar commands like test_commit, "git checkout --orphan",
and "git merge" will do.

While at it, wrap the setup commands in a test assertion so errors can
be caught and stray output suppressed when running without --verbose
as in other tests.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rev-parse test: use test_cmp instead of "test" builtinJonathan Nieder Tue, 3 Sep 2013 17:07:15 +0000 (10:07 -0700)

rev-parse test: use test_cmp instead of "test" builtin

Use test_cmp instead of passing two command substitutions to the
"test" builtin. This way:

- when tests fail, they can print a helpful diff if run with
"--verbose"

- the argument order "test_cmp expect actual" feels natural,
unlike test <known> = <unknown> that seems backwards

- the exit status from invoking git is checked, so if rev-parse
starts segfaulting then the test will notice and fail

Use a custom function for this instead of test_cmp_rev to emphasize
that we are testing the output from "git rev-parse" with certain
arguments, not checking that the revisions are equal in abstract.

Reported-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rev-parse test: use test_must_fail, not "if <command... Felipe Contreras Tue, 3 Sep 2013 17:06:18 +0000 (10:06 -0700)

rev-parse test: use test_must_fail, not "if <command>; then false; fi"

This way, if rev-parse segfaults then the test will fail instead
of treating it the same way as a controlled failure.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rev-parse test: modernize quoting and whitespaceFelipe Contreras Tue, 3 Sep 2013 17:05:32 +0000 (10:05 -0700)

rev-parse test: modernize quoting and whitespace

Instead of cramming everything in one line, put the test body in an
indented block after the opening test_expect_success line and quote
and put the closing quote on a line by itself.

Use single-quote instead of double-quote to quote the test body
for more useful --verbose output.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule: fix confusing variable nameBrian M. Carlson Sat, 17 Aug 2013 17:25:42 +0000 (17:25 +0000)

submodule: fix confusing variable name

cmd_summary reads the output of git diff, but reads in the submodule path into a
variable called name. Since this variable does not contain the name of the
submodule, but the path, rename it to be clearer what data it actually holds.

Signed-off-by: Brian M. Carlson <sandals@crustytoothpaste.net>
Acked-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-export: refactor get_tags_and_duplicates()Felipe Contreras Sun, 1 Sep 2013 07:05:48 +0000 (02:05 -0500)

fast-export: refactor get_tags_and_duplicates()

Split into a separate helper function get_commit() so that the part that
finds the relevant commit, and the part that does something with it
(handle tag object, etc.) are in different places.

No functional changes.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-export: make extra_refs globalFelipe Contreras Sun, 1 Sep 2013 07:05:47 +0000 (02:05 -0500)

fast-export: make extra_refs global

There's no need to pass it around everywhere. This would make easier
further refactoring that makes use of this variable.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t: branch: fix broken && chainsFelipe Contreras Sat, 31 Aug 2013 04:31:50 +0000 (23:31 -0500)

t: branch: fix broken && chains

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>