git.git
11 years agogit-remote-mediawiki: update comments to reflect credential support
Matthieu Moy [Sun, 8 Jul 2012 16:18:28 +0000 (18:18 +0200)]
git-remote-mediawiki: update comments to reflect credential support

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-remote-mediawiki: be more defensive when requests fail
Matthieu Moy [Fri, 6 Jul 2012 10:03:15 +0000 (12:03 +0200)]
git-remote-mediawiki: be more defensive when requests fail

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-remote-mediawiki: more efficient 'pull' in the best case
Matthieu Moy [Fri, 6 Jul 2012 10:03:14 +0000 (12:03 +0200)]
git-remote-mediawiki: more efficient 'pull' in the best case

The only way to fetch new revisions from a wiki before this patch was to
query each page for new revisions. This is good when tracking a small set
of pages on a large wiki, but very inefficient when tracking many pages
on a wiki with little activity.

Implement a new strategy that queries the wiki for its last global
revision, queries each new revision, and filter out pages that are not
tracked.

Signed-off-by: Simon Perrat <simon.perrat@ensimag.imag.fr>
Signed-off-by: Simon CATHEBRAS <Simon.Cathebras@ensimag.imag.fr>
Signed-off-by: Julien KHAYAT <Julien.Khayat@ensimag.imag.fr>
Signed-off-by: Charles ROUSSEL <Charles.Roussel@ensimag.imag.fr>
Signed-off-by: Guillaume SASDY <Guillaume.Sasdy@ensimag.imag.fr>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-remote-mediawiki: extract revision-importing loop to a function
Matthieu Moy [Fri, 6 Jul 2012 10:03:13 +0000 (12:03 +0200)]
git-remote-mediawiki: extract revision-importing loop to a function

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-remote-mediawiki: refactor loop over revision ids
Matthieu Moy [Fri, 6 Jul 2012 10:03:12 +0000 (12:03 +0200)]
git-remote-mediawiki: refactor loop over revision ids

Without changing the behavior, we turn the foreach loop on an array of
revisions into a loop on an array of integer. It will be easier to
implement other strategies as they will only need to produce an array of
integer instead of a more complex data-structure.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-remote-mediawiki: change return type of get_mw_pages
Matthieu Moy [Fri, 6 Jul 2012 10:03:11 +0000 (12:03 +0200)]
git-remote-mediawiki: change return type of get_mw_pages

The previous version was returning the list of pages to be fetched, but
we are going to need an efficient membership test (i.e. is the page
$title tracked), hence exposing a hash will be more convenient.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-remote-mediawiki (t9363): test 'File:' import and export
NGUYEN Kim Thuat [Fri, 6 Jul 2012 10:03:10 +0000 (12:03 +0200)]
git-remote-mediawiki (t9363): test 'File:' import and export

Signed-off-by: Pavel Volek <Pavel.Volek@ensimag.imag.fr>
Signed-off-by: NGUYEN Kim Thuat <Kim-Thuat.Nguyen@ensimag.imag.fr>
Signed-off-by: ROUCHER IGLESIAS Javier <roucherj@ensimag.imag.fr>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-remote-mediawiki: support for uploading file in test environment
Matthieu Moy [Fri, 6 Jul 2012 10:03:09 +0000 (12:03 +0200)]
git-remote-mediawiki: support for uploading file in test environment

This will be used for testing git-remote-mediawiki's import feature on a
wiki containing media files.

Signed-off-by: Simon CATHEBRAS <Simon.Cathebras@ensimag.imag.fr>
Signed-off-by: Julien KHAYAT <Julien.Khayat@ensimag.imag.fr>
Signed-off-by: Simon Perrat <simon.perrat@ensimag.imag.fr>
Signed-off-by: Charles ROUSSEL <Charles.Roussel@ensimag.imag.fr>
Signed-off-by: Guillaume SASDY <Guillaume.Sasdy@ensimag.imag.fr>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-remote-mediawiki (t9362): test git-remote-mediawiki with UTF8 characters
Simon Cathebras [Fri, 6 Jul 2012 10:03:08 +0000 (12:03 +0200)]
git-remote-mediawiki (t9362): test git-remote-mediawiki with UTF8 characters

Non-ascii encoding create many particular cases when used in page
content, name, and edit/commit message. Test these cases.

Signed-off-by: Simon CATHEBRAS <Simon.Cathebras@ensimag.imag.fr>
Signed-off-by: Julien KHAYAT <Julien.Khayat@ensimag.imag.fr>
Signed-off-by: Simon Perrat <simon.perrat@ensimag.imag.fr>
Signed-off-by: Charles ROUSSEL <Charles.Roussel@ensimag.imag.fr>
Signed-off-by: Guillaume SASDY <Guillaume.Sasdy@ensimag.imag.fr>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-remote-mediawiki (t9361): test git-remote-mediawiki pull and push
Guillaume Sasdy [Fri, 6 Jul 2012 10:03:07 +0000 (12:03 +0200)]
git-remote-mediawiki (t9361): test git-remote-mediawiki pull and push

This patch provides a set of tests for the pull and push fonctionnality
of git-remote-mediawiki. The actual tests are kept in a separate function
to allow further tests to re-run the same set of commands with different
push and pull strategies.

Signed-off-by: Simon CATHEBRAS <Simon.Cathebras@ensimag.imag.fr>
Signed-off-by: Julien KHAYAT <Julien.Khayat@ensimag.imag.fr>
Signed-off-by: Simon Perrat <simon.perrat@ensimag.imag.fr>
Signed-off-by: Charles ROUSSEL <Charles.Roussel@ensimag.imag.fr>
Signed-off-by: Guillaume SASDY <Guillaume.Sasdy@ensimag.imag.fr>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-remote-mediawiki (t9360): test git-remote-mediawiki clone
Guillaume Sasdy [Fri, 6 Jul 2012 10:03:06 +0000 (12:03 +0200)]
git-remote-mediawiki (t9360): test git-remote-mediawiki clone

Signed-off-by: Simon CATHEBRAS <Simon.Cathebras@ensimag.imag.fr>
Signed-off-by: Julien KHAYAT <Julien.Khayat@ensimag.imag.fr>
Signed-off-by: Simon Perrat <simon.perrat@ensimag.imag.fr>
Signed-off-by: Charles ROUSSEL <Charles.Roussel@ensimag.imag.fr>
Signed-off-by: Guillaume SASDY <Guillaume.Sasdy@ensimag.imag.fr>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-remote-mediawiki: test environment of git-remote-mediawiki
Guillaume Sasdy [Fri, 6 Jul 2012 10:03:05 +0000 (12:03 +0200)]
git-remote-mediawiki: test environment of git-remote-mediawiki

In order to test git-remote-mediawiki, a set of functions is needed to
manage a MediaWiki: edit a page, remove a page, fetch a page, fetch all
pages on a given wiki.

A few helper function are also provided to check the content of
directories.

In addition, this patch provides Makefiles to execute tests.
See the README file for more details.

Signed-off-by: Simon CATHEBRAS <Simon.Cathebras@ensimag.imag.fr>
Signed-off-by: Julien KHAYAT <Julien.Khayat@ensimag.imag.fr>
Signed-off-by: Simon Perrat <simon.perrat@ensimag.imag.fr>
Signed-off-by: Charles ROUSSEL <Charles.Roussel@ensimag.imag.fr>
Signed-off-by: Guillaume SASDY <Guillaume.Sasdy@ensimag.imag.fr>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-remote-mediawiki: scripts to install, delete and clear a MediaWiki
Guillaume Sasdy [Fri, 6 Jul 2012 10:03:04 +0000 (12:03 +0200)]
git-remote-mediawiki: scripts to install, delete and clear a MediaWiki

install_wiki.sh allows the user to install a MediaWiki instance in a
single shell command. Like "git instaweb", it configures and launches
lighttpd without requiring root priviledges. To simplify database
management, it uses SQLite, which doesn't require a running daemon, and
allows reseting the database by simply replacing a single file. This
allows install_wiki to also defines a function wiki_reset which clear all
content of the previously created wiki, which will be very useful to run
several indepenant tests on the same wiki.

Note those functionnalities are made to be used from the user command
line in the directory git/contrib/mw-to-git/t/

Signed-off-by: Simon CATHEBRAS <Simon.Cathebras@ensimag.imag.fr>
Signed-off-by: Julien KHAYAT <Julien.Khayat@ensimag.imag.fr>
Signed-off-by: Simon Perrat <simon.perrat@ensimag.imag.fr>
Signed-off-by: Charles ROUSSEL <Charles.Roussel@ensimag.imag.fr>
Signed-off-by: Guillaume SASDY <Guillaume.Sasdy@ensimag.imag.fr>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit p4: refactor diffOpts calculation
Gary Gibbons [Wed, 4 Jul 2012 13:40:19 +0000 (09:40 -0400)]
git p4: refactor diffOpts calculation

P4Submit.applyCommit()

To avoid recalculating the same diffOpts for each commit, move it
out of applyCommit() and into the top-level run().  Also fix a bug
in that code which interpreted the value of detectRenames as a
string rather than as a boolean.

[pw: fix documentation, rearrange code a bit]

Signed-off-by: Gary Gibbons <ggibbons@perforce.com>
Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit p4: notice Jobs lines in git commit messages
Pete Wyckoff [Wed, 4 Jul 2012 13:34:20 +0000 (09:34 -0400)]
git p4: notice Jobs lines in git commit messages

P4 has a feature called "jobs" that allows linking changes
to a bug tracking system or other tasks.  When submitting
code, a job name can be specified to mark that this change
is associated with a particular job.

Teach git-p4 to find an optional "Jobs:" line in git commit
messages and use them to make a Jobs section in the p4
change specifitation.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit p4 test: refactor marshal_dump
Pete Wyckoff [Wed, 4 Jul 2012 13:34:19 +0000 (09:34 -0400)]
git p4 test: refactor marshal_dump

This function will be useful in future tests.  Move it to
the git-p4 test library.  Let it accept an optional argument
to pick a certain marshaled object out of the input stream.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit p4: remove unused P4Submit interactive setting
Pete Wyckoff [Wed, 4 Jul 2012 13:34:18 +0000 (09:34 -0400)]
git p4: remove unused P4Submit interactive setting

The code is unused.  Delete.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agovcs-svn: allow 64-bit Prop-Content-Length
Jonathan Nieder [Fri, 6 Jul 2012 03:47:47 +0000 (22:47 -0500)]
vcs-svn: allow 64-bit Prop-Content-Length

Currently the vcs-svn/ library only pays attention to the presence of
the Prop-Content-Length field and doesn't care about its value, but
some day we might care about the value.  Parse it as an off_t instead
of arbitrarily limiting to 32 bits for intuitiveness.

So now you can import from a dump with more than 2 GiB of properties
for a node.  In practice that isn't likely to happen often, and this
is mostly meant as a cleanup.

Based-on-patch-by: David Barr <davidbarr@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
11 years agovcs-svn: suppress a signed/unsigned comparison warning
Jonathan Nieder [Fri, 6 Jul 2012 03:21:09 +0000 (22:21 -0500)]
vcs-svn: suppress a signed/unsigned comparison warning

All callers pass a nonnegative delta_len, so the code is already safe.
Add an assertion to ensure that remains so and add a cast to keep
clang and gcc -Wsign-compare from worrying.

Reported-by: David Barr <davidbarr@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
11 years agovcs-svn: suppress a signed/unsigned comparison warning
David Barr [Thu, 31 May 2012 14:41:29 +0000 (00:41 +1000)]
vcs-svn: suppress a signed/unsigned comparison warning

The preceding code checks that view->max_off is nonnegative and
(off + width) fits in an off_t, so this code is already safe.

Signed-off-by: David Barr <davidbarr@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
11 years agovcs-svn: suppress signed/unsigned comparison warnings
David Barr [Thu, 31 May 2012 14:41:29 +0000 (00:41 +1000)]
vcs-svn: suppress signed/unsigned comparison warnings

These are already safe because both sides of the comparison are
nonnegative.

This would normally not be important because Git is not -Wsign-compare
clean anyway, but we like to keep the vcs-svn/ lib to a higher
standard for convenience using it in other projects.

Signed-off-by: David Barr <davidbarr@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
11 years agovcs-svn: use strstr instead of memmem
David Barr [Thu, 31 May 2012 14:41:28 +0000 (00:41 +1000)]
vcs-svn: use strstr instead of memmem

memmem is a GNU extension.

Avoiding it makes the code clearer and makes it easier for projects
that don't share git's compat/ code, such as the standalone
svn-dump-fast-export project, to reuse the vcs-svn/ library.

Signed-off-by: David Barr <davidbarr@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
11 years agovcs-svn: use constcmp instead of prefixcmp
David Barr [Thu, 31 May 2012 14:41:27 +0000 (00:41 +1000)]
vcs-svn: use constcmp instead of prefixcmp

Since the length of t is already known, we can simplify a little by
using memcmp() instead of strncmp() to carry out a prefix comparison.
All nearby code already does this.

Noticed in the standalone svn-dump-fast-export project which has not
needed to implement prefixcmp() yet.

Signed-off-by: David Barr <davidbarr@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
11 years agovcs-svn: simplify cleanup in apply_one_window
David Barr [Thu, 31 May 2012 14:41:26 +0000 (00:41 +1000)]
vcs-svn: simplify cleanup in apply_one_window

Currently the cleanup code looks like this:

free resources
return 0;
 error_out:
free resources
return -1;

Avoid duplicating the "free resources" part by keeping the return
value in a variable and sharing code between the success and
exceptional case:

ret = 0;
 out:
free resources
return ret;

Noticed in the svn-dump-fast-export project, where using the error()
macro in void context produces a warning.

Signed-off-by: David Barr <davidbarr@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
11 years agovcs-svn: avoid self-assignment in dummy initialization of pre_off
David Barr [Thu, 31 May 2012 14:41:25 +0000 (00:41 +1000)]
vcs-svn: avoid self-assignment in dummy initialization of pre_off

Without this change, clang complains:

 vcs-svn/svndiff.c:298:3: warning: Assigned value is garbage or undefined
                 off_t pre_off = pre_off; /* stupid GCC... */
                 ^               ~~~~~~~

This code uses an old and common idiom for suppressing an
"uninitialized variable" warning, and clang is wrong to warn about it.
The idiom tells the compiler to leave the variable uninitialized,
which saves a few bytes of code size, and, more importantly, allows
valgrind to check at runtime that the variable is properly initialized
by the time it is used.

But MSVC and clang do not know that idiom, so let's avoid it in
vcs-svn/ code.

Initialize pre_off to -1, a recognizably meaningless value, to allow
future code changes that cause pre_off to be used before it is
initialized to be caught early.

Signed-off-by: David Barr <davidbarr@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
11 years agovcs-svn: drop no-op reset methods
David Barr [Thu, 31 May 2012 14:41:30 +0000 (00:41 +1000)]
vcs-svn: drop no-op reset methods

Since v1.7.5~42^2~6 (vcs-svn: remove buffer_read_string)
buffer_reset() does nothing thus fast_export_reset() also.

Signed-off-by: David Barr <davidbarr@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
11 years agol10n: zh_CN.po: translate 29 new messages
Jiang Xin [Wed, 4 Jul 2012 09:20:34 +0000 (17:20 +0800)]
l10n: zh_CN.po: translate 29 new messages

Translate 29 new messages came from git.pot update in 11b9017
(l10n: Update git.pot (29 new messages))

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
11 years agot3404: make test 57 work with dash and others
Michael J Gruber [Wed, 4 Jul 2012 11:32:04 +0000 (13:32 +0200)]
t3404: make test 57 work with dash and others

The construct

VAR=value test_must_fail command args

works only for some shells (such as bash) but not others (such as dash)
because VAR=value does not end up in the environment for command when it
is called by the shell function test_must_fail. That is why we explicitly
set and export variable in a subshell, i.e.

(
VAR=value &&
export VAR &&
test_must_fail command args
)

in most places already, bar the newly introduced 57 from b64b7fe
(Add tests for rebase -i --root without --onto, 2012-06-26).

Make test 57 use that construct also.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agol10n: de.po: translate 29 new messages
Ralf Thielow [Tue, 3 Jul 2012 16:02:11 +0000 (18:02 +0200)]
l10n: de.po: translate 29 new messages

Translate 29 new messages came from git.pot update
in 11b9017 (l10n: Update git.pot (29 new messages)).

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
11 years agogit-remote-mediawiki: improve support for non-English Wikis
Matthieu Moy [Wed, 4 Jul 2012 12:53:36 +0000 (14:53 +0200)]
git-remote-mediawiki: improve support for non-English Wikis

Mediafiles can live in namespaces with names different from Image
and File. While at it, rework the code to make it simpler and easier
to read.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoFourth batch for 1.7.12
Junio C Hamano [Thu, 5 Jul 2012 06:48:37 +0000 (23:48 -0700)]
Fourth batch for 1.7.12

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'nd/clone-single-fix'
Junio C Hamano [Thu, 5 Jul 2012 06:41:41 +0000 (23:41 -0700)]
Merge branch 'nd/clone-single-fix'

"git clone --single-branch" to clone a single branch did not limit
the cloning to the specified branch.

* nd/clone-single-fix:
  clone: fix ref selection in --single-branch --branch=xxx

11 years agoMerge branch 'th/diff-no-index-fixes'
Junio C Hamano [Thu, 5 Jul 2012 06:40:38 +0000 (23:40 -0700)]
Merge branch 'th/diff-no-index-fixes'

"git diff --no-index" did not correctly handle relative paths and
did not give correct exit codes when run under "--quiet" option.

* th/diff-no-index-fixes:
  diff-no-index: exit(1) if 'diff --quiet <repo file> <external file>' finds changes
  diff: handle relative paths in no-index

11 years agoMerge branch 'hv/remote-end-hung-up'
Junio C Hamano [Thu, 5 Jul 2012 06:40:11 +0000 (23:40 -0700)]
Merge branch 'hv/remote-end-hung-up'

When we get disconnected while expecting a response from the remote
side because authentication failed, we issued an error message "The
remote side hung up unexpectedly."

Give hint that it may be a permission problem in the message when we
can reasonably suspect it.

* hv/remote-end-hung-up:
  remove the impression of unexpectedness when access is denied

11 years agoUpdate Swedish translation (1095t0f0u)
Peter Krefting [Wed, 4 Jul 2012 18:34:21 +0000 (19:34 +0100)]
Update Swedish translation (1095t0f0u)

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
11 years agopush: don't guess at qualifying remote refs on deletion
Jeff King [Tue, 3 Jul 2012 18:04:39 +0000 (14:04 -0400)]
push: don't guess at qualifying remote refs on deletion

When we try to push a ref and the right-hand side of the
refspec does not find a match, we try to create it. If it is
not fully qualified, we try to guess where it would go in
the refs hierarchy based on the left-hand source side. If
the source side is not a ref, then we give up and give a
long explanatory message.

For deletions, however, this doesn't make any sense. We
would never want to create on the remote side, and if an
unqualified ref can't be matched, it is simply an error. The
current code handles this already because the left-hand side
is empty, and therefore does not give us a hint as to where
the right-hand side should go, and we properly error out.
Unfortunately, the error message is the long "we tried to
qualify this, but the source side didn't let us guess"
message, which is quite confusing.

Instead, we can just be more succinct and say "we can't
delete this because we couldn't find it". So before:

  $ git push origin :bogus
  error: unable to push to unqualified destination: bogus
  The destination refspec neither matches an existing ref on the remote nor
  begins with refs/, and we are unable to guess a prefix based on the source ref.
  error: failed to push some refs to '$URL'

and now:

  $ git push origin :bogus
  error: unable to delete 'bogus': remote ref does not exist
  error: failed to push some refs to '$URL'

It is tempting to also catch a fully-qualified ref like
"refs/heads/bogus" and generate the same error message.
However, that currently does not error out at all, and
instead gets sent to the remote side, which typically
generates a warning:

  $ git push origin:refs/heads/bogus
  remote: warning: Deleting a non-existent ref.
  To $URL
   - [deleted]         bogus

While it would be nice to catch this error early, a
client-side error would mean aborting the push entirely and
changing push's exit code. For example, right now you can
do:

  $ git push origin refs/heads/foo refs/heads/bar

and end up in a state where "foo" and "bar" are deleted,
whether both of them currently exist or not (and see an
error only if we actually failed to contact the server).
Generating an error would cause a regression for this use
case.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoFix formatting in git-config(1)
Andreas Schwab [Sat, 23 Jun 2012 13:18:00 +0000 (15:18 +0200)]
Fix formatting in git-config(1)

This fixes two formatting bugs in the git-config documentation:

- in the column.ui entry don't indent the last paragraph so that it isn't
  formatted as a literal paragraph
- in the push.default entry separate the last paragraph from the
  nested list.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agol10n: Update translation for Vietnamese
Tran Ngoc Quan [Tue, 3 Jul 2012 07:22:32 +0000 (14:22 +0700)]
l10n: Update translation for Vietnamese

 * Translated 29 news
 * Fix some minor errors in old translation

Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
11 years agol10n: Update git.pot (29 new messages)
Jiang Xin [Tue, 3 Jul 2012 02:31:59 +0000 (10:31 +0800)]
l10n: Update git.pot (29 new messages)

Generate po/git.pot from v1.7.11.1-107-g72601, and there are 29 new l10n
messages.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
11 years agoSync with i18n-po updates in maint
Junio C Hamano [Mon, 2 Jul 2012 22:37:54 +0000 (15:37 -0700)]
Sync with i18n-po updates in maint

# By Peter Krefting
# Via Junio C Hamano (1) and Peter Krefting (1)
* maint:
  Update Swedish translation (1066t0f0u)

11 years agoMerge branch 'maint' of git://github.com/git-l10n/git-po into maint
Junio C Hamano [Mon, 2 Jul 2012 22:36:52 +0000 (15:36 -0700)]
Merge branch 'maint' of git://github.com/git-l10n/git-po into maint

Update Swedish translation (1066t0f0u)

11 years agoblame: compute abbreviation width that ensures uniqueness
Junio C Hamano [Mon, 2 Jul 2012 07:54:00 +0000 (00:54 -0700)]
blame: compute abbreviation width that ensures uniqueness

Julia Lawall noticed that in linux-next repository the commit object
60d5c9f5 (shown with the default abbreviation width baked into "git
blame") in output from

  $ git blame -L 3675,3675 60d5c9f5b -- \
      drivers/staging/brcm80211/brcmfmac/wl_iw.c

is no longer unique in the repository, which results in "short SHA1
60d5c9f5 is ambiguous".

Compute the minimum abbreviation width that ensures uniqueness when
the user did not specify the --abbrev option to avoid this.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoUpdate Swedish translation (1066t0f0u)
Peter Krefting [Sun, 1 Jul 2012 22:04:09 +0000 (23:04 +0100)]
Update Swedish translation (1066t0f0u)

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
11 years agoperl/Makefile: Fix a missing double-quote
Johannes Sixt [Fri, 29 Jun 2012 08:07:44 +0000 (10:07 +0200)]
perl/Makefile: Fix a missing double-quote

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agodiff-index.c: "git diff" has no need to read blob from the standard input
Junio C Hamano [Thu, 28 Jun 2012 03:14:47 +0000 (20:14 -0700)]
diff-index.c: "git diff" has no need to read blob from the standard input

Only "diff --no-index -" does.  Bolting the logic into the low-level
function diff_populate_filespec() was a layering violation from day
one.  Move populate_from_stdin() function out of the generic diff.c
to its only user, diff-index.c.

Also make sure "-" from the command line stays a special token "read
from the standard input", even if we later decide to sanitize the
result from prefix_filename() function in a few obvious ways,
e.g. removing unnecessary "./" prefix, duplicated slashes "//" in
the middle, etc.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agodiff-index.c: unify handling of command line paths
Junio C Hamano [Wed, 27 Jun 2012 19:05:52 +0000 (12:05 -0700)]
diff-index.c: unify handling of command line paths

Regardless of where in the directory hierarchy you are, "-" on the
command line means the standard input.  The old code knew too much
about how the low level machinery uses paths to read from the
working tree and did not bother to have the same check for "-" when
the command is run from the top-level.

Unify the codepaths for subdirectory case and toplevel case into one
and make it clearer.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agodiff-index.c: do not pretend paths are pathspecs
Junio C Hamano [Wed, 27 Jun 2012 18:51:15 +0000 (11:51 -0700)]
diff-index.c: do not pretend paths are pathspecs

"git diff --no-index" takes exactly two paths, not pathspecs, and
has its own way queue_diff() to populate the diff_queue.  Do not
call diff_tree_setup_paths(), pretending as it takes pathspecs.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoThird batch for 1.7.12
Junio C Hamano [Thu, 28 Jun 2012 22:35:37 +0000 (15:35 -0700)]
Third batch for 1.7.12

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'fc/git-prompt-script'
Junio C Hamano [Thu, 28 Jun 2012 22:21:00 +0000 (15:21 -0700)]
Merge branch 'fc/git-prompt-script'

Split a rather heavy-ish "git completion" script out to create a
separate "git prompting" script, to help lazy-autoloading of the
completion part while making prompting part always available.

11 years agoMerge branch 'js/submodule-relative'
Junio C Hamano [Thu, 28 Jun 2012 22:20:55 +0000 (15:20 -0700)]
Merge branch 'js/submodule-relative'

Teach "git submodule" deal with nested submodule structure where a
module is contained within a module whose origin is specified as a
relative URL to its superproject's origin.

11 years agoMerge branch 'lk/more-helpful-status-hints'
Junio C Hamano [Thu, 28 Jun 2012 22:20:35 +0000 (15:20 -0700)]
Merge branch 'lk/more-helpful-status-hints'

Give finer classification to various states of paths in conflicted
state and offer advice messages in the "git status" output.

11 years agoMerge branch 'lk/rebase-i-x'
Junio C Hamano [Thu, 28 Jun 2012 22:20:23 +0000 (15:20 -0700)]
Merge branch 'lk/rebase-i-x'

Teach "-x <cmd>" to "rebase -i" to insert "exec <cmd>" after each
commit in the resulting history.

11 years agoMerge branch 'jc/rev-list-simplify-merges-first-parent'
Junio C Hamano [Thu, 28 Jun 2012 22:20:16 +0000 (15:20 -0700)]
Merge branch 'jc/rev-list-simplify-merges-first-parent'

When "--simplify-merges/by-decoration" is given together with
"--first-parent" to "git log", the combination of these options
makes the simplification logic to use in-core commit objects that
haven't been examined for relevance, either producing incorrect
result or taking too long to produce any output.  Teach the
simplification logic to ignore commits that the first-parent
traversal logic ignored when both are in effect to work around the
issue.

11 years agoMerge branch 'hv/submodule-update-nuke-submodules'
Junio C Hamano [Thu, 28 Jun 2012 22:20:08 +0000 (15:20 -0700)]
Merge branch 'hv/submodule-update-nuke-submodules'

"git add" allows adding a regular file to the path where a submodule
used to exist, but "git update-index" does not allow an equivalent
operation to Porcelain writers.

11 years agoMerge branch 'nd/exclude-workaround-top-heavy'
Junio C Hamano [Thu, 28 Jun 2012 22:19:57 +0000 (15:19 -0700)]
Merge branch 'nd/exclude-workaround-top-heavy'

Attempt to optimize matching with an exclude pattern with a deep
directory hierarchy by taking the part that specifies leading path
without wildcard literally.

11 years agoMerge branch 'nd/stream-pack-objects'
Junio C Hamano [Thu, 28 Jun 2012 22:19:51 +0000 (15:19 -0700)]
Merge branch 'nd/stream-pack-objects'

"pack-objects" learned to read large loose blobs using the streaming API,
without the need to hold everything in core at once.

11 years agoMerge branch 'nd/stream-index-pack'
Junio C Hamano [Thu, 28 Jun 2012 22:19:42 +0000 (15:19 -0700)]
Merge branch 'nd/stream-index-pack'

Use streaming API to read from the object store to avoid having to hold
a large blob object in-core while running index-pack.

11 years agoMerge branch 'mm/verify-filename-fix'
Junio C Hamano [Thu, 28 Jun 2012 22:19:31 +0000 (15:19 -0700)]
Merge branch 'mm/verify-filename-fix'

"git diff COPYING HEAD:COPYING" gave a nonsense error message that
claimed that the treeish HEAD did not have COPYING in it.

11 years agoMerge branch 'jk/diff-no-index-pager'
Junio C Hamano [Thu, 28 Jun 2012 22:19:11 +0000 (15:19 -0700)]
Merge branch 'jk/diff-no-index-pager'

"git diff --no-index" did not work with pagers correctly.

11 years agoAllow help.htmlpath to be a URL prefix
Chris Webb [Thu, 28 Jun 2012 06:58:03 +0000 (07:58 +0100)]
Allow help.htmlpath to be a URL prefix

Setting this to a URL prefix instead of a path to a local directory allows
git-help --web to work even when HTML docs aren't locally installed, by
pointing the browser at a copy accessible on the web. For example,

    [help]
      format = html
      htmlpath = http://git-scm.com/docs

will use the publicly available documentation on the git homepage.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoAdd config variable to set HTML path for git-help --web
Chris Webb [Thu, 28 Jun 2012 06:58:02 +0000 (07:58 +0100)]
Add config variable to set HTML path for git-help --web

If set in git-config, help.htmlpath overrides system_path(GIT_HTML_PATH)
which was compiled in. This allows users to repoint system-wide git at
their own copy of the documentation without recompiling.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit p4 test: fix badp4dir test
Pete Wyckoff [Wed, 27 Jun 2012 12:01:03 +0000 (08:01 -0400)]
git p4 test: fix badp4dir test

The construct used to get the return code was flawed, in that
errors in the &&-chain before the semicolon were not caught.  Use
the standard test_expect_code instead.

Set PATH in a subshell instead of relying on the bashism of
setting it just for a single command.

And fix the grep line so it doesn't worry about grep segfaults,
and doesn't fail for i18n issues.

Reported-by: Johannes Sixt <j.sixt@viscovery.net>
Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit p4 test: split up big t9800 test
Pete Wyckoff [Wed, 27 Jun 2012 12:01:02 +0000 (08:01 -0400)]
git p4 test: split up big t9800 test

The original t9800 test code has a mix of assorted topics, some
of which are big enough to deserve their own homes.
Interdependencies between the topics make it confusing when
trying to study one in isolation.  And it takes so long to run
that debugging an individual test is difficult.

Split out three big chunks of tests into their own files:

    t9812-git-p4-wildcards.sh gets the 8 p4 wildcard tests

    t9813-git-p4-preserve-users.sh gets the 4 --preserve-user tests

    t9814-git-p4-rename.sh gets the 2 copy and rename tests

Test 9800 execution time drops from 29 sec to 9 sec.  The
sequential time to run all tests is a slower due to the three
extra p4d startup/shutdown sequences, but the overall parallel
execution time is about the same, at 52 sec.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit p4 test: cleanup_git should make a new $git
Pete Wyckoff [Wed, 27 Jun 2012 12:01:01 +0000 (08:01 -0400)]
git p4 test: cleanup_git should make a new $git

For convenience, leave one in place at the end of each
test so that it is not necessary to build a new one.  This
makes it consistent with $cli.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit p4 test: copy source indeterminate
Pete Wyckoff [Wed, 27 Jun 2012 12:01:00 +0000 (08:01 -0400)]
git p4 test: copy source indeterminate

Msysgit testing showed that the source file found by copy
detection is indeterminate when there are multiple sources
to choose from.  This appears to be valid.  Adjust the test
so that it passes if it finds any of the potential copy sources.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit p4 test: check for error message in failed test
Pete Wyckoff [Wed, 27 Jun 2012 12:00:59 +0000 (08:00 -0400)]
git p4 test: check for error message in failed test

Make sure the test fails for the expected reason.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit p4 test: rename some "git-p4 command" strings
Pete Wyckoff [Wed, 27 Jun 2012 12:00:58 +0000 (08:00 -0400)]
git p4 test: rename some "git-p4 command" strings

Use the actual command name; git-p4 is gone.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit p4 test: never create default test repo
Pete Wyckoff [Wed, 27 Jun 2012 12:00:57 +0000 (08:00 -0400)]
git p4 test: never create default test repo

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit p4 test: simplify quoting involving TRASH_DIRECTORY
Pete Wyckoff [Wed, 27 Jun 2012 12:00:56 +0000 (08:00 -0400)]
git p4 test: simplify quoting involving TRASH_DIRECTORY

For temporary files that are created in the top-level TRASH_DIRECTORY,
trust that the tests do not chdir except in subshells, and avoid some
quoting.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit p4 test: use real_path to resolve p4 client symlinks
Pete Wyckoff [Wed, 27 Jun 2012 12:00:55 +0000 (08:00 -0400)]
git p4 test: use real_path to resolve p4 client symlinks

The p4 program is finicky about making sure the recorded client Root
matches the current working directory.  The way it discovers the latter
seems to be to inspect shell variable $PWD.  This could involve symlinks,
that while leading to the same place as the client Root, look different,
and cause p4 to fail.

Resolve all client paths using "test-path-utils real_path $path".  This
removes ".." and resolves all symlinks.

Discovered while running with --root=/dev/shm, which is a link to
/run/shm.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit p4 test: wait longer for p4d to start and test its pid
Pete Wyckoff [Thu, 28 Jun 2012 02:48:07 +0000 (22:48 -0400)]
git p4 test: wait longer for p4d to start and test its pid

Running tests at high parallelism on a slow machine, 5 sec is
not enough to wait for p4d to start.  Change it to 5 minutes,
adding an environment variable P4D_START_PATIENCE to shrink
that if needed in automated test environments.

Also check if the pid of the p4d that we started is still
around.  If not, quit waiting for it immediately.

Remove all the confusing && chaining and simplify the code.

Thanks-to: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agofast-export: quote paths with spaces
Jay Soffian [Wed, 27 Jun 2012 21:58:01 +0000 (17:58 -0400)]
fast-export: quote paths with spaces

A path containing a space must be quoted when used as an
argument to either the copy or rename commands (because
unlike other commands, the path is not the final thing on
the line for those commands).

Commit 6280dfdc3b (fast-export: quote paths in output,
2011-08-05) previously attempted to fix fast-export's
quoting by passing all paths through quote_c_style().
However, that function does not consider the space to be a
character which requires quoting, so let's special-case the
space inside print_path(). This will cause space-containing
paths to also be quoted in other commands where such quoting
is not strictly necessary, but it does not hurt to do so.

The test from 6280dfdc3b did not detect this because, while
it does introduce renames in the export stream, it does not
actually turn on rename detection, so they were presented as
pairs of deletions/adds. Using "-M" reveals the bug.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-remote-mediawiki: import "File:" attachments
Pavel Volek [Wed, 27 Jun 2012 14:21:29 +0000 (16:21 +0200)]
git-remote-mediawiki: import "File:" attachments

Add the symmetrical feature to the "File:" export support in the previous
patch. Download files from the wiki as needed, and feed them into the
fast-import stream. Import both the file itself, and the corresponding
description page.

Signed-off-by: Pavel Volek <Pavel.Volek@ensimag.imag.fr>
Signed-off-by: NGUYEN Kim Thuat <Kim-Thuat.Nguyen@ensimag.imag.fr>
Signed-off-by: ROUCHER IGLESIAS Javier <roucherj@ensimag.imag.fr>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-remote-mediawiki: split get_mw_pages into smaller functions
Matthieu Moy [Wed, 27 Jun 2012 09:10:19 +0000 (11:10 +0200)]
git-remote-mediawiki: split get_mw_pages into smaller functions

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-remote-mediawiki: send "File:" attachments to a remote wiki
NGUYEN Kim Thuat [Wed, 27 Jun 2012 09:10:18 +0000 (11:10 +0200)]
git-remote-mediawiki: send "File:" attachments to a remote wiki

The current version of the git-remote-mediawiki supports only import and
export of plain wiki pages. This patch adds the functionality to export
file attachments (i.e. the content of the File: MediaWiki namespace),
which are also exposed by MediaWiki API.

This requires a recent version of MediaWiki::API (Version 0.37 works.
Version 0.34 doesn't).

Signed-off-by: Pavel Volek <Pavel.Volek@ensimag.imag.fr>
Signed-off-by: NGUYEN Kim Thuat <Kim-Thuat.Nguyen@ensimag.imag.fr>
Signed-off-by: ROUCHER IGLESIAS Javier <roucherj@ensimag.imag.fr>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-remote-mediawiki: don't "use encoding 'utf8';"
Matthieu Moy [Wed, 27 Jun 2012 09:10:17 +0000 (11:10 +0200)]
git-remote-mediawiki: don't "use encoding 'utf8';"

The use of this statement is generally discouraged, and is too intrusive
for us: it forces the HTTP requests made by the API to contain only valid
UTF-8 characters. This would break the upload of binary files.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-remote-mediawiki: don't compute the diff when getting commit message
Matthieu Moy [Wed, 27 Jun 2012 09:10:16 +0000 (11:10 +0200)]
git-remote-mediawiki: don't compute the diff when getting commit message

While we're there, simplify the code a bit: since log --format=%s anyway
shows the subject line as a single line, no need to split to take the
first line.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoadd test case for rebase of empty commit
Martin von Zweigbergk [Wed, 27 Jun 2012 16:22:01 +0000 (09:22 -0700)]
add test case for rebase of empty commit

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoAdd tests for rebase -i --root without --onto
Chris Webb [Tue, 26 Jun 2012 21:55:24 +0000 (22:55 +0100)]
Add tests for rebase -i --root without --onto

Test for likely breakages in t3404, including successful reordering of
non-conflicting changes with a new root, correct preservation of commit
message and author in a root commit when it is squashed with the
sentinel, and presence of the sentinel following a conflicting
cherry-pick of a new root.

Remove test_must_fail for git rebase --root without --onto from t3412 as
this case will now be successfully handled by an implicit git rebase -i.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agorebase -i: support --root without --onto
Chris Webb [Tue, 26 Jun 2012 21:55:23 +0000 (22:55 +0100)]
rebase -i: support --root without --onto

Allow --root to be specified to rebase -i without --onto, making it
possible to edit and re-order all commits right back to the root(s).

If there is a conflict to be resolved when applying the first change,
the user will expect a sane index and working tree to get sensible
behaviour from git-diff and friends, so create a sentinel commit with an
empty tree to rebase onto. Automatically squash the sentinel with any
commits rebased directly onto it, so they end up as root commits in
their own right and retain their authorship and commit message.

Implicitly use rebase -i for non-interactive rebase of --root without
an --onto argument now that rebase -i can correctly do this.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoindex-pack: Disable threading on cygwin
Junio C Hamano [Tue, 26 Jun 2012 18:19:32 +0000 (19:19 +0100)]
index-pack: Disable threading on cygwin

The Cygwin implementation of pread() is not thread-safe since, just
like the emulation provided by compat/pread.c, it uses a sequence of
seek-read-seek calls. In order to avoid failues due to thread-safety
issues, commit b038a61 disables threading when NO_PREAD is defined.
(ie when using the emulation code in compat/pread.c).

We introduce a new build variable, NO_THREAD_SAFE_PREAD, which allows
use to disable the threaded index-pack code on cygwin, in addition to
the above NO_PREAD case.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoam: don't call mailinfo if $rebasing
Martin von Zweigbergk [Tue, 26 Jun 2012 14:51:57 +0000 (07:51 -0700)]
am: don't call mailinfo if $rebasing

Since 5e835ca (rebase: do not munge commit log message, 2008-04-16),
'git am --rebasing' no longer gets the commit log message from the
patch, but reads it from the commit identified by the "From " header
line. From 43c2325 (am: use get_author_ident_from_commit instead of
mailinfo when rebasing, 2010-06-16), it also gets the author name,
email and date from the commit. Now that the final part of the patch
-- the patch body itself -- is also read from the commit, there is no
longer a need to call 'git mailinfo' to extract any of these parts
while --rebasing.

Sugested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoam --rebasing: get patch body from commit, not from mailbox
Martin von Zweigbergk [Tue, 26 Jun 2012 14:51:56 +0000 (07:51 -0700)]
am --rebasing: get patch body from commit, not from mailbox

Rebasing a commit that contains a diff in the commit message results
in a failure with output such as

  First, rewinding head to replay your work on top of it...
  Applying: My cool patch.
  fatal: sha1 information is lacking or useless
  (app/controllers/settings_controller.rb).
  Repository lacks necessary blobs to fall back on 3-way merge.
  Cannot fall back to three-way merge.
  Patch failed at 0001 My cool patch.

The reason is that 'git rebase' without -p/-i/-m internally calls 'git
format-patch' and pipes the output to 'git am --rebasing', which has
no way of knowing what is a real patch and what is a commit message
that contains a patch.

Make 'git am' while in --rebasing mode get the patch body from the
commit object instead of extracting it from the mailbox.

Patch by Junio, test case and commit log message by Martin.

Reported-by: anikey <arty.anikey@gmail.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agorebase --root: print usage on too many args
Martin von Zweigbergk [Tue, 26 Jun 2012 14:51:55 +0000 (07:51 -0700)]
rebase --root: print usage on too many args

Just like

  git rebase --onto newbase upstream branch error

displays the usage message, so should clearly

  git rebase --onto newbase --root branch error

, but it doesn't. Instead, it ignores both "branch" and "error" and
rebases the current HEAD. This is because we try to match the number
of remainging arguments "$#", which fails to match "1" argument and
matches the "*" that really should have been a "0".

Make sure we display usage information when too many arguments are
given. Also fail-fast in case of similar bugs in the future by
matching on exactly 0 arguments and failing on unknown numbers.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agorebase: don't source git-sh-setup twice
Martin von Zweigbergk [Tue, 26 Jun 2012 14:51:54 +0000 (07:51 -0700)]
rebase: don't source git-sh-setup twice

The git-sh-setup script is already sourced in git-rebase.sh before
calling into git-rebase--(am|interactive|merge).sh. There are no other
callers of these scripts. It is therefore unnecessary to source
git-sh-setup again in them.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-checkout: disallow --detach on unborn branch
Chris Webb [Tue, 26 Jun 2012 15:06:42 +0000 (16:06 +0100)]
git-checkout: disallow --detach on unborn branch

abe199808c (git checkout -b: allow switching out of an unborn branch)
introduced a bug demonstrated by

  git checkout --orphan foo
  git checkout --detach
  git symbolic-ref HEAD

which gives 'refs/heads/(null)'.

This happens because we strbuf_addf(&branch_ref, "refs/heads/%s",
opts->new_branch) when opts->new_branch can be NULL for --detach.

Catch and forbid this case, adding a test to t2017 to catch it in
future.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-remote-mediawiki: add credential support
Matthieu Moy [Sun, 24 Jun 2012 11:40:01 +0000 (13:40 +0200)]
git-remote-mediawiki: add credential support

The previous version implemented the possibility to log in a wiki, but
the username and password had to be provided as configuration variables.
We add the possibility to use the Git credential system to prompt
the password.

The support if implemented with generic functions that mimic the C API,
designed to be usable from other contexts in the future (i.e. they may
migrate to Git.pm if someone is interested).

While we're there, do a bit of refactoring in mw_connect_maybe.

Based on patch by: Javier Roucher Iglesias <Javier.Roucher-Iglesias@ensimag.imag.fr>

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit credential fill: output the whole 'struct credential'
Matthieu Moy [Sun, 24 Jun 2012 11:40:00 +0000 (13:40 +0200)]
git credential fill: output the whole 'struct credential'

Instead of outputing only the username and password, print all the
attributes, even those that already appeared in the input.

This is closer to what the C API does, and allows one to take the exact
output of "git credential fill" as input to "git credential approve" or
"git credential reject".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoadd 'git credential' plumbing command
Javier Roucher Iglesias [Sun, 24 Jun 2012 11:39:59 +0000 (13:39 +0200)]
add 'git credential' plumbing command

The credential API is in C, and not available to scripting languages.
Expose the functionalities of the API by wrapping them into a new
plumbing command "git credentials".

In other words, replace the internal "test-credential" by an official Git
command.

Most documentation writen by: Jeff King <peff@peff.net>
Signed-off-by: Pavel Volek <Pavel.Volek@ensimag.imag.fr>
Signed-off-by: Kim Thuat Nguyen <Kim-Thuat.Nguyen@ensimag.imag.fr>
Signed-off-by: Javier Roucher Iglesias <Javier.Roucher-Iglesias@ensimag.imag.fr>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoSecond batch for 1.7.12
Junio C Hamano [Mon, 25 Jun 2012 18:31:07 +0000 (11:31 -0700)]
Second batch for 1.7.12

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'lp/no-cmd-http-fetch'
Junio C Hamano [Mon, 25 Jun 2012 18:25:48 +0000 (11:25 -0700)]
Merge branch 'lp/no-cmd-http-fetch'

Remove unused declarations of nonexisting functions from a header
file.

* lp/no-cmd-http-fetch:
  builtin.h: remove unused cmd_<foo> declarations

11 years agoMerge branch 'cn/cherry-pick-range-docs'
Junio C Hamano [Mon, 25 Jun 2012 18:25:38 +0000 (11:25 -0700)]
Merge branch 'cn/cherry-pick-range-docs'

The command line argument of "git cherry-pick maint master..next" is
just an ordinary revision range, which is unintuitive and at least
deserves documentation.

* cn/cherry-pick-range-docs:
  git-cherry-pick.txt: clarify the use of revision range notation
  Documentation: --no-walk is no-op if range is specified

11 years agoMerge branch 'lm/git-blame-el'
Junio C Hamano [Mon, 25 Jun 2012 18:25:12 +0000 (11:25 -0700)]
Merge branch 'lm/git-blame-el'

eLisp fixes for a contrib/ script.

* lm/git-blame-el:
  git-blame.el: Do not use bare 0 to mean (point-min)
  git-blame.el: Use with-current-buffer where appropriate
  git-blame.el: Do not use goto-line in lisp code

11 years agoMerge branch 'rs/ipv6-ssh-url'
Junio C Hamano [Mon, 25 Jun 2012 18:25:06 +0000 (11:25 -0700)]
Merge branch 'rs/ipv6-ssh-url'

ssh:// URLs to IPv6 hosts with custom port number were parsed
incorrectly.

* rs/ipv6-ssh-url:
  git: Wrong parsing of ssh urls with IPv6 literals ignores port

11 years agoMerge branch 'jc/ustar-checksum-is-unsigned'
Junio C Hamano [Mon, 25 Jun 2012 18:24:57 +0000 (11:24 -0700)]
Merge branch 'jc/ustar-checksum-is-unsigned'

"git archive" incorrectly computed the header checksum; the symptom
was observed only when using pathnames with hi-bit set.

* jc/ustar-checksum-is-unsigned:
  archive: ustar header checksum is computed unsigned

11 years agoMerge branch 'rs/git-blame-mapcar-mapc'
Junio C Hamano [Mon, 25 Jun 2012 18:24:52 +0000 (11:24 -0700)]
Merge branch 'rs/git-blame-mapcar-mapc'

* rs/git-blame-mapcar-mapc:
  git-blame.el: use mapc instead of mapcar

11 years agoMerge branch 'rr/doc-commit'
Junio C Hamano [Mon, 25 Jun 2012 18:24:42 +0000 (11:24 -0700)]
Merge branch 'rr/doc-commit'

* rr/doc-commit:
  commit: document a couple of options

11 years agoMerge branch 'nd/i18n-misc'
Junio C Hamano [Mon, 25 Jun 2012 18:24:37 +0000 (11:24 -0700)]
Merge branch 'nd/i18n-misc'

Restructure the way message strings are created, in preparation for
marking them for i18n.

* nd/i18n-misc:
  rerere: remove i18n legos in result message
  notes-merge: remove i18n legos in merge result message
  reflog: remove i18n legos in pruning message

11 years agoMerge branch 'nd/i18n-branch-lego'
Junio C Hamano [Mon, 25 Jun 2012 18:24:20 +0000 (11:24 -0700)]
Merge branch 'nd/i18n-branch-lego'

Restructure the way message strings are created, in preparation for
marking them for i18n.

* nd/i18n-branch-lego:
  Remove i18n legos in notifying new branch tracking setup

11 years agoMerge branch 'jk/no-more-asciidoc7'
Junio C Hamano [Mon, 25 Jun 2012 18:24:10 +0000 (11:24 -0700)]
Merge branch 'jk/no-more-asciidoc7'

We no longer use AsciiDoc7 syntax in our documentation and favor a
more modern style.

* jk/no-more-asciidoc7:
  docs: drop antique comment from Makefile
  docs: drop asciidoc7compatible flag