git.git
11 years agohttp: prompt for credentials on failed POST
Jeff King [Mon, 27 Aug 2012 13:27:15 +0000 (09:27 -0400)]
http: prompt for credentials on failed POST

All of the smart-http GET requests go through the http_get_*
functions, which will prompt for credentials and retry if we
see an HTTP 401.

POST requests, however, do not go through any central point.
Moreover, it is difficult to retry in the general case; we
cannot assume the request body fits in memory or is even
seekable, and we don't know how much of it was consumed
during the attempt.

Most of the time, this is not a big deal; for both fetching
and pushing, we make a GET request before doing any POSTs,
so typically we figure out the credentials during the first
request, then reuse them during the POST. However, some
servers may allow a client to get the list of refs from
receive-pack without authentication, and then require
authentication when the client actually tries to POST the
pack.

This is not ideal, as the client may do a non-trivial amount
of work to generate the pack (e.g., delta-compressing
objects). However, for a long time it has been the
recommended example configuration in git-http-backend(1) for
setting up a repository with anonymous fetch and
authenticated push. This setup has always been broken
without putting a username into the URL. Prior to commit
986bbc0, it did work with a username in the URL, because git
would prompt for credentials before making any requests at
all. However, post-986bbc0, it is totally broken. Since it
has been advertised in the manpage for some time, we should
make sure it works.

Unfortunately, it is not as easy as simply calling post_rpc
again when it fails, due to the input issue mentioned above.
However, we can still make this specific case work by
retrying in two specific instances:

  1. If the request is large (bigger than LARGE_PACKET_MAX),
     we will first send a probe request with a single flush
     packet. Since this request is static, we can freely
     retry it.

  2. If the request is small and we are not using gzip, then
     we have the whole thing in-core, and we can freely
     retry.

That means we will not retry in some instances, including:

  1. If we are using gzip. However, we only do so when
     calling git-upload-pack, so it does not apply to
     pushes.

  2. If we have a large request, the probe succeeds, but
     then the real POST wants authentication. This is an
     extremely unlikely configuration and not worth worrying
     about.

While it might be nice to cover those instances, doing so
would be significantly more complex for very little
real-world gain. In the long run, we will be much better off
when curl learns to internally handle authentication as a
callback, and we can cleanly handle all cases that way.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agohttp: factor out http error code handling
Jeff King [Mon, 27 Aug 2012 13:26:04 +0000 (09:26 -0400)]
http: factor out http error code handling

Most of our http requests go through the http_request()
interface, which does some nice post-processing on the
results. In particular, it handles prompting for missing
credentials as well as approving and rejecting valid or
invalid credentials. Unfortunately, it only handles GET
requests. Making it handle POSTs would be quite complex, so
let's pull result handling code into its own function so
that it can be reused from the POST code paths.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agot: test http access to "half-auth" repositories
Jeff King [Mon, 27 Aug 2012 13:25:53 +0000 (09:25 -0400)]
t: test http access to "half-auth" repositories

Some sites set up http access to repositories such that
fetching is anonymous and unauthenticated, but pushing is
authenticated. While there are multiple ways to do this, the
technique advertised in the git-http-backend manpage is to
block access to locations matching "/git-receive-pack$".

Let's emulate that advice in our test setup, which makes it
clear that this advice does not actually work.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agot: test basic smart-http authentication
Jeff King [Mon, 27 Aug 2012 13:25:36 +0000 (09:25 -0400)]
t: test basic smart-http authentication

We do not currently test authentication over smart-http at
all. In theory, it should work exactly as it does for dumb
http (which we do test). It does indeed work for these
simple tests, but this patch lays the groundwork for more
complex tests in future patches.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agot/lib-httpd: recognize */smart/* repos as smart-http
Jeff King [Mon, 27 Aug 2012 13:25:21 +0000 (09:25 -0400)]
t/lib-httpd: recognize */smart/* repos as smart-http

We do not currently test authentication for smart-http repos
at all. Part of the infrastructure to do this is recognizing
that auth/smart is indeed a smart-http repo.

The current apache config recognizes only "^/smart/*" as
smart-http. Let's instead treat anything with /smart/ in the
URL as smart-http. This is obviously a stupid thing to do
for a real production site, but for our test suite we know
that our repositories will not have this magic string in the
name.

Note that we will route /foo/smart/bar.git directly to
git-http-backend/bar.git; in other words, everything before
the "/smart/" is irrelevant to finding the repo on disk (but
may impact apache config, for example by triggering auth
checks).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agot/lib-httpd: only route auth/dumb to dumb repos
Jeff King [Mon, 27 Aug 2012 13:24:42 +0000 (09:24 -0400)]
t/lib-httpd: only route auth/dumb to dumb repos

Our test apache config points all of auth/ directly to the
on-disk repositories via an Alias directive. This works fine
because everything authenticated is currently in auth/dumb,
which is a subset.  However, this would conflict with a
ScriptAlias for auth/smart (which will come in future
patches), so let's narrow the Alias.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agot5550: factor out http auth setup
Jeff King [Mon, 27 Aug 2012 13:24:31 +0000 (09:24 -0400)]
t5550: factor out http auth setup

The t5550 script sets up a nice askpass helper for
simulating user input and checking what git prompted for.
Let's make it available to other http scripts by migrating
it to lib-httpd.

We can use this immediately in t5540 to make our tests more
robust (previously, we did not check at all that hitting the
password-protected repo actually involved a password).
Unfortunately, we end up failing the test because the
current code erroneously prompts twice (once for
git-remote-http, and then again when the former spawns
git-http-push).

More importantly, though, it will let us easily add
smart-http authentication tests in t5541 and t5551; we
currently do not test smart-http authentication at all.

As part of making it generic, let's always look for and
store auxiliary askpass files at the top-level trash
directory; this makes it compatible with t5540, which runs
some tests from sub-repositories. We can abstract away the
ugliness with a short helper function.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agot5550: put auth-required repo in auth/dumb
Jeff King [Mon, 27 Aug 2012 13:23:37 +0000 (09:23 -0400)]
t5550: put auth-required repo in auth/dumb

In most of our tests, we put repos to be accessed by dumb
protocols in /dumb, and repos to be accessed by smart
protocols in /smart.  In our test apache setup, the whole
/auth hierarchy requires authentication. However, we don't
bother to split it by smart and dumb here because we are not
currently testing smart-http authentication at all.

That will change in future patches, so let's be explicit
that we are interested in testing dumb access here. This
also happens to match what t5540 does for the push tests.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoGit 1.7.10.5 v1.7.10.5
Junio C Hamano [Sun, 17 Jun 2012 21:04:15 +0000 (14:04 -0700)]
Git 1.7.10.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoDo not autosquash in case of an implied interactive rebase
Vincent van Ravesteijn [Thu, 24 May 2012 13:57:26 +0000 (13:57 +0000)]
Do not autosquash in case of an implied interactive rebase

The option to autosquash is only used in case of an interactive rebase.
When merges are preserved, rebase uses an interactive rebase internally,
but in this case autosquash should still be disabled.

Signed-off-by: Vincent van Ravesteijn <vfr@lyx.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'js/maint-fast-export-mark-error' into maint
Junio C Hamano [Sun, 17 Jun 2012 21:00:03 +0000 (14:00 -0700)]
Merge branch 'js/maint-fast-export-mark-error' into maint

"git fast-export" did not give a readable error message when the same
mark erroneously appeared twice in the --import-marks input.

12 years agofast-export: report SHA-1 instead of gibberish when marks exist already
Johannes Schindelin [Tue, 12 Jun 2012 13:45:16 +0000 (15:45 +0200)]
fast-export: report SHA-1 instead of gibberish when marks exist already

Cc: Pieter de Bie <pdebie@ai.rug.nl>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Max Horn <max@quendi.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoGit 1.7.10.4 v1.7.10.4
Junio C Hamano [Sun, 3 Jun 2012 22:53:58 +0000 (15:53 -0700)]
Git 1.7.10.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'ef/maint-rebase-error-message' into maint
Junio C Hamano [Sun, 3 Jun 2012 22:52:18 +0000 (15:52 -0700)]
Merge branch 'ef/maint-rebase-error-message' into maint

When "git rebase" was given a bad commit to replay the history on,
its error message did not correctly give the command line argument
it had trouble parsing.

By Erik Faye-Lund
* ef/maint-rebase-error-message:
  rebase: report invalid commit correctly

12 years agoStart preparing for 1.7.10.4
Junio C Hamano [Fri, 1 Jun 2012 20:05:27 +0000 (13:05 -0700)]
Start preparing for 1.7.10.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'ef/http-o-depends-on-gvf' into maint
Junio C Hamano [Fri, 1 Jun 2012 20:22:44 +0000 (13:22 -0700)]
Merge branch 'ef/http-o-depends-on-gvf' into maint

A minor compilation fix.

By Erik Faye-Lund
* ef/http-o-depends-on-gvf:
  Makefile: add missing GIT-VERSION-FILE dependency

12 years agoMerge branch 'rs/maint-grep-F' into maint
Junio C Hamano [Fri, 1 Jun 2012 20:01:41 +0000 (13:01 -0700)]
Merge branch 'rs/maint-grep-F' into maint

"git grep -e '$pattern'", unlike the case where the patterns are read from
a file, did not treat individual lines in the given pattern argument as
separate regular expressions as it should.

By René Scharfe
* rs/maint-grep-F:
  grep: stop leaking line strings with -f
  grep: support newline separated pattern list
  grep: factor out do_append_grep_pat()
  grep: factor out create_grep_pat()

12 years agoMerge branch 'jk/ident-split-fix' into maint
Junio C Hamano [Fri, 1 Jun 2012 20:01:36 +0000 (13:01 -0700)]
Merge branch 'jk/ident-split-fix' into maint

An author/committer name that is a single character was mishandled as an
invalid name by mistake.

By Jeff King
* jk/ident-split-fix:
  fix off-by-one error in split_ident_line

12 years agoMerge branch 'jk/pretty-commit-header-incomplete-line' into maint
Junio C Hamano [Fri, 1 Jun 2012 20:01:33 +0000 (13:01 -0700)]
Merge branch 'jk/pretty-commit-header-incomplete-line' into maint

By Jeff King
* jk/pretty-commit-header-incomplete-line:
  avoid segfault when reading header of malformed commits

12 years agoMerge branch 'jk/format-person-part-buffer-limit' into maint
Junio C Hamano [Fri, 1 Jun 2012 19:59:58 +0000 (12:59 -0700)]
Merge branch 'jk/format-person-part-buffer-limit' into maint

By Jeff King
* jk/format-person-part-buffer-limit:
  pretty: avoid buffer overflow in format_person_part

12 years agoMerge branch 'ap/checkout-no-progress-for-non-tty' into maint
Junio C Hamano [Fri, 1 Jun 2012 19:59:50 +0000 (12:59 -0700)]
Merge branch 'ap/checkout-no-progress-for-non-tty' into maint

"git checkout" gave progress display even when the standard error
stream was not connected to the tty, which made little sense.

By Avery Pennarun
* ap/checkout-no-progress-for-non-tty:
  checkout: no progress messages if !isatty(2).

12 years agoMerge branch 'maint' of git://github.com/git-l10n/git-po into maint
Junio C Hamano [Fri, 1 Jun 2012 19:50:41 +0000 (12:50 -0700)]
Merge branch 'maint' of git://github.com/git-l10n/git-po into maint

By Peter Krefting
via Peter Krefting
* 'maint' of git://github.com/git-l10n/git-po:
  Update Swedish translation (728t0f0u)

12 years agoMakefile: add missing GIT-VERSION-FILE dependency
Erik Faye-Lund [Thu, 31 May 2012 14:10:44 +0000 (16:10 +0200)]
Makefile: add missing GIT-VERSION-FILE dependency

In 20fc9bc (Set HTTP user agent to git/GIT_VERSION, 2006-04-04),
http.o started recording GIT_VERSION, but http.o wasn't added
to the list of files that depends on GIT-VERSION-FILE.

Fix this, so mofications to GIT-VERSION-FILE will result in an
updated user-agent string.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agorebase: report invalid commit correctly
Erik Faye-Lund [Wed, 30 May 2012 16:39:42 +0000 (18:39 +0200)]
rebase: report invalid commit correctly

In 9765b6a (rebase: align variable content, 2011-02-06), the code
to error out was moved up one level. Unfortunately, one reference
to a function parameter wasn't rewritten as it should, leading to
the wrong parameter being errored on.

This error was propagated by 71786f5 (rebase: factor out reference
parsing, 2011-02-06) and merged in 78c6e0f (Merge branch
'mz/rebase', 2011-04-28).

Correct this by reporting $onto_name istead.

Reported-By: Manuela Hutter <manuelah@opera.com>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoUpdate Swedish translation (728t0f0u)
Peter Krefting [Tue, 29 May 2012 08:28:34 +0000 (09:28 +0100)]
Update Swedish translation (728t0f0u)

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
12 years agoGit 1.7.10.3 v1.7.10.3
Junio C Hamano [Fri, 25 May 2012 18:28:43 +0000 (11:28 -0700)]
Git 1.7.10.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'hv/submodule-alt-odb' into maint
Junio C Hamano [Fri, 25 May 2012 18:26:38 +0000 (11:26 -0700)]
Merge branch 'hv/submodule-alt-odb' into maint

When a submodule repository uses alternate object store mechanism, some
commands that were started from the superproject did not notice it and
failed with "No such object" errors.  The subcommands of "git submodule"
command that recursed into the submodule in a separate process were OK;
only the ones that cheated and peeked directly into the submodule's
repository from the primary process were affected.

By Heiko Voigt
* hv/submodule-alt-odb:
  teach add_submodule_odb() to look for alternates

12 years agoMerge branch 'bp/diff-no-index-strbuf-fix' into maint
Junio C Hamano [Fri, 25 May 2012 18:25:36 +0000 (11:25 -0700)]
Merge branch 'bp/diff-no-index-strbuf-fix' into maint

The directory path used in "git diff --no-index", when it recurses
down, was broken with a recent update after v1.7.10.1 release.

By Bobby Powers
* bp/diff-no-index-strbuf-fix:
  diff --no-index: don't leak buffers in queue_diff
  diff --no-index: reset temporary buffer lengths on directory iteration

12 years agofmt-merge-message: add empty line between tag and signature verification
Linus Torvalds [Fri, 25 May 2012 16:02:03 +0000 (09:02 -0700)]
fmt-merge-message: add empty line between tag and signature verification

When adding the information from a tag, put an empty line between the
message of the tag and the commented-out signature verification
information.

At least for the kernel workflow, I often end up re-formatting the message
that people send me in the tag data. In that situation, putting the tag
message and the tag signature verification back-to-back then means that
normal editor "reflow parapgraph" command will get confused and think that
the signature is a continuation of the last message paragraph.

So I always end up having to first add an empty line, and then go back and
reflow the last paragraph. Let's just do it in git directly.

The extra vertical space also makes the verification visually stand out
more from the user-supplied message, so it looks a bit more readable to me
too, but that may be just an odd personal preference.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoconfig doc: remove confusion about relative GIT_DIR from FILES section
Jonathan Nieder [Fri, 25 May 2012 18:12:04 +0000 (13:12 -0500)]
config doc: remove confusion about relative GIT_DIR from FILES section

From the FILES section of the git-config(1) manual:

$GIT_DIR/config::
Repository specific configuration file. (The filename is
of course relative to the repository root, not the working
directory.)

That's confusing because $GIT_DIR really is relative to the working
directory.

$ GIT_DIR=.git GIT_EDITOR='pwd; echo editing'
$ export GIT_DIR GIT_EDITOR
$ git config --edit --local
/home/jrn/src/git/Documentation
editing .git/config

It turns out that the comment is a remnant from older days when the
heading said ".git/config" (which is indeed relative to the top of the
worktree).

It was only when the heading was changed to refer more precisely to
<git dir>/config (see v1.5.3.2~18, AsciiDoc tweak to avoid leading
dot, 2007-09-14) that the parenthesis stopped making sense.  Remove
it.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoUpdate draft release notes to 1.7.10.3
Junio C Hamano [Fri, 25 May 2012 00:37:29 +0000 (17:37 -0700)]
Update draft release notes to 1.7.10.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jk/maint-status-porcelain-z-b' into maint
Junio C Hamano [Fri, 25 May 2012 00:32:30 +0000 (17:32 -0700)]
Merge branch 'jk/maint-status-porcelain-z-b' into maint

"git status --porcelain" ignored "--branch" option by mistake.  The output
for "git status --branch -z" was also incorrect and did not terminate the
record for the current branch name with NUL as asked.

By Jeff King
* jk/maint-status-porcelain-z-b:
  status: respect "-b" for porcelain format
  status: fix null termination with "-b"
  status: refactor null_termination option
  commit: refactor option parsing

12 years agocheckout: no progress messages if !isatty(2).
Avery Pennarun [Thu, 24 May 2012 06:12:24 +0000 (02:12 -0400)]
checkout: no progress messages if !isatty(2).

If stderr isn't a tty, we shouldn't be printing incremental progress
messages.  In particular, this affects 'git checkout -f . >&logfile'
unless you provided -q.  And git-new-workdir has no way to provide -q.

It would probably be better to have progress.c check isatty(2) all the time,
but that wouldn't allow things like 'git push --progress' to force progress
reporting to on, so I won't try to solve the general case right now.

Actual fix suggested by Jeff King.

Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoosxkeychain: pull make config from top-level directory
Jeff King [Wed, 23 May 2012 17:36:53 +0000 (13:36 -0400)]
osxkeychain: pull make config from top-level directory

The default compiler and cflags were mostly "works for me"
when I built the original version. We need to be much less
careful here than usual, because we know we are building
only on OS X.  But it's only polite to at least respect the
CFLAGS and CC definitions that the user may have provided
earlier.

While we're at it, let's update our definitions and rules to
be more like the top-level Makefile; default our CFLAGS to
include -O2, and make sure we use CFLAGS and LDFLAGS when
linking.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoavoid segfault when reading header of malformed commits
Jeff King [Tue, 22 May 2012 04:52:17 +0000 (00:52 -0400)]
avoid segfault when reading header of malformed commits

If a commit object has a header line at the end of the
buffer that is missing its newline (or if it appears so
because the content on the header line contains a stray
NUL), then git will segfault.

Interestingly, this case is explicitly handled and we do
correctly scan the final line for the header we are looking
for. But if we don't find it, we will dereference NULL while
trying to look at the next line.

Git will never generate such a commit, but it's good to be
defensive. We could die() in such a case, but since it's
easy enough to handle it gracefully, let's just issue a
warning and continue (so you could still view such a commit
with "git show", though you might be missing headers after
the NUL).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agopretty: avoid buffer overflow in format_person_part
Jeff King [Tue, 22 May 2012 05:45:08 +0000 (01:45 -0400)]
pretty: avoid buffer overflow in format_person_part

When we parse the name and email from a commit to
pretty-print them, we usually can just put the result
directly into our strbuf result. However, if we are going to
use the mailmap, then we must first copy them into a
NUL-terminated buffer to feed to the mailmap machinery.

We did so by using strlcpy into a static buffer, but we used
it wrong. We fed it the length of the substring we wanted to
copy, but never checked that that length was less than the
size of the destination buffer.

The simplest fix is to just use snprintf to copy the
substring properly while still respecting the destination
buffer's size. It might seem like replacing the static
buffer with a strbuf would help, but we need to feed a
static buffer to the mailmap machinery anyway, so there's
not much benefit to handling arbitrary sizes.

A more ideal solution would be for mailmap to grow an
interface that:

  1. Takes a pointer and length combination, instead of
     assuming a NUL-terminated string.

  2. Returns a pointer to the mailmap's allocated string,
     rather than copying it into the buffer.

Then we could avoid the need for an extra buffer entirely.
However, doing this would involve a lot of refactoring of
mailmap and of string_list (which mailmap uses to store the
map itself). For now, let's do the simplest thing to fix the
bug.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agofix off-by-one error in split_ident_line
Jeff King [Tue, 22 May 2012 06:12:20 +0000 (02:12 -0400)]
fix off-by-one error in split_ident_line

Commit 4b340cf split the logic to parse an ident line out of
pretty.c's format_person_part. But in doing so, it
accidentally introduced an off-by-one error that caused it
to think that single-character names were invalid.

This manifested itself as the "%an" format failing to show
anything at all for a single-character name.

Reported-by: Brian Turner <bturner@atlassian.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogrep: stop leaking line strings with -f
René Scharfe [Mon, 21 May 2012 16:10:09 +0000 (18:10 +0200)]
grep: stop leaking line strings with -f

When reading patterns from a file, we pass the lines as allocated string
buffers to append_grep_pat() and never free them.  That's not a problem
because they are needed until the program ends anyway.

However, now that the function duplicates the pattern string, we can
reuse the strbuf after calling that function.  This simplifies the code
a bit and plugs a minor memory leak.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogrep: support newline separated pattern list
René Scharfe [Sun, 20 May 2012 14:33:07 +0000 (16:33 +0200)]
grep: support newline separated pattern list

Currently, patterns that contain newline characters don't match anything
when given to git grep.  Regular grep(1) interprets patterns as lists of
newline separated search strings instead.

Implement this functionality by creating and inserting extra grep_pat
structures for patterns consisting of multiple lines when appending to
the pattern lists.  For simplicity, all pattern strings are duplicated.
The original pattern is truncated in place to make it contain only the
first line.

Requested-by: Torne (Richard Coles) <torne@google.com>
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogrep: factor out do_append_grep_pat()
René Scharfe [Sun, 20 May 2012 14:32:54 +0000 (16:32 +0200)]
grep: factor out do_append_grep_pat()

Add do_append_grep_pat() as a shared function for adding patterns to
the header pattern list and the general pattern list.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogrep: factor out create_grep_pat()
René Scharfe [Sun, 20 May 2012 14:32:39 +0000 (16:32 +0200)]
grep: factor out create_grep_pat()

Add create_grep_pat(), a shared helper for all grep pattern allocation
and initialization needs.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoConsistently use "superproject" instead of "supermodule"
Jens Lehmann [Sun, 20 May 2012 13:28:26 +0000 (15:28 +0200)]
Consistently use "superproject" instead of "supermodule"

We fairly consistently say "superproject" and never "supermodule" these
days. But there are seven occurrences of "supermodule" left in the current
work tree. Three appear in Release Notes for 1.5.3 and 1.7.7, three in
test names and one in a C-code comment.

Replace all occurrences of "supermodule" outside of the Release Notes
(which shouldn't be changed after the fact) with "superproject" for
consistency.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agot3404: begin "exchange commits with -p" test with correct preconditions
Johannes Sixt [Sat, 19 May 2012 13:14:16 +0000 (15:14 +0200)]
t3404: begin "exchange commits with -p" test with correct preconditions

The test case shows a bug in 'rebase -p', but even if the bug were fixed
the test would fail because it did not ensure that the preconditions match
the postconditions that were checked. Insert the suitable 'git checkout'.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agodiff --no-index: don't leak buffers in queue_diff
Bobby Powers [Wed, 16 May 2012 14:50:31 +0000 (10:50 -0400)]
diff --no-index: don't leak buffers in queue_diff

queue_diff uses two strbufs, and at the end of the function
strbuf_reset was called.  This only reset the length of the buffer -
any allocated memory was leaked.  Using strbuf_release fixes this.

Signed-off-by: Bobby Powers <bobbypowers@gmail.com>
Reviewed-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agodiff --no-index: reset temporary buffer lengths on directory iteration
Bobby Powers [Wed, 16 May 2012 14:28:31 +0000 (10:28 -0400)]
diff --no-index: reset temporary buffer lengths on directory iteration

Commit 875b91b (diff --no-index: use strbuf for temporary pathnames,
2012-04-25) introduced a regression when using diff --no-index with
directories.  When iterating through a directory, the switch to strbuf
from heap-allocated char arrays caused paths to form like 'dir/file1',
'dir/file1file2', rather than 'dir/file1', 'dir/file2' as expected.

Avoid this by resetting the paths variables to their original length
before each iteration.

Signed-off-by: Bobby Powers <bobbypowers@gmail.com>
Reviewed-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agol10n: de.po: translate 3 new messages
Ralf Thielow [Tue, 15 May 2012 17:00:40 +0000 (19:00 +0200)]
l10n: de.po: translate 3 new messages

Translate 3 new messages for upcoming git 1.7.10.3.

Signed-off-by: Ralf Thielow <ralf.thielow@googlemail.com>
12 years agol10n: zh_CN.po: translate 3 new messages
Jiang Xin [Tue, 15 May 2012 03:53:26 +0000 (11:53 +0800)]
l10n: zh_CN.po: translate 3 new messages

Translate 3 new messages for upcoming git 1.7.10.3.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
12 years agol10n: Update git.pot (3 new, 2 removed messages)
Jiang Xin [Mon, 14 May 2012 22:36:36 +0000 (06:36 +0800)]
l10n: Update git.pot (3 new, 2 removed messages)

Generate po/git.pot from v1.7.10.2-35-g0b9f4:

 * 3 new l10n messages at lines: 2743, 2751, 2759.

 * 2 removed l10n messages from lines: 1879, 2757.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
12 years agoteach add_submodule_odb() to look for alternates
Heiko Voigt [Mon, 14 May 2012 16:24:45 +0000 (18:24 +0200)]
teach add_submodule_odb() to look for alternates

Since we allow to link other object databases when loading a submodules
database we should also load possible alternates.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'maint' of git://github.com/git-l10n/git-po into maint
Junio C Hamano [Mon, 14 May 2012 18:47:49 +0000 (11:47 -0700)]
Merge branch 'maint' of git://github.com/git-l10n/git-po into maint

By Ralf Thielow (6) and others
via Jiang Xin
* 'maint' of git://github.com/git-l10n/git-po:
  l10n: zh_CN.po: translate 1 new message
  l10n: de.po: translate one new message
  l10n: de.po: unify translation of "ahead" and "behind"
  l10n: de.po: collection of improvements
  l10n: de.po: translate "remote" as "extern"
  l10n: de.po: translate "track" as "beobachten"
  l10n: add new members to German translation team
  l10n: de.po: collection of suggestions
  l10n: de.po: translate "bad" as "ungültig" ("invalid")
  l10n: de.po: hopefully uncontroversial fixes
  l10n: de.po: translate "bare" as "bloß"
  l10n: Update git.pot (1 new messages)

12 years agoStart preparing for 1.7.10.3
Junio C Hamano [Mon, 14 May 2012 18:47:20 +0000 (11:47 -0700)]
Start preparing for 1.7.10.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jk/maint-reflog-walk-count-vs-time' into maint
Junio C Hamano [Mon, 14 May 2012 18:46:16 +0000 (11:46 -0700)]
Merge branch 'jk/maint-reflog-walk-count-vs-time' into maint

Gives a better DWIM behaviour for --pretty=format:%gd, "stash list", and
"log -g", depending on how the starting point ("master" vs "master@{0}" vs
"master@{now}") and date formatting options (e.g. "--date=iso") are given
on the command line.

By Jeff King (4) and Junio C Hamano (1)
* jk/maint-reflog-walk-count-vs-time:
  reflog-walk: tell explicit --date=default from not having --date at all
  reflog-walk: always make HEAD@{0} show indexed selectors
  reflog-walk: clean up "flag" field of commit_reflog struct
  log: respect date_mode_explicit with --format:%gd
  t1411: add more selector index/date tests

12 years agoMerge branch 'jk/doc-asciidoc-inline-literal' into maint
Junio C Hamano [Mon, 14 May 2012 18:43:04 +0000 (11:43 -0700)]
Merge branch 'jk/doc-asciidoc-inline-literal' into maint

By Jeff King
* jk/doc-asciidoc-inline-literal:
  docs: stop using asciidoc no-inline-literal

12 years agoMerge branch 'ef/checkout-empty' into maint
Junio C Hamano [Mon, 14 May 2012 18:42:49 +0000 (11:42 -0700)]
Merge branch 'ef/checkout-empty' into maint

Running "git checkout" on an unborn branch used to corrupt HEAD
(regression in 1.7.10); this makes it error out.

By Erik Faye-Lund
* ef/checkout-empty:
  checkout: do not corrupt HEAD on empty repo

12 years agoMerge branch 'jk/maint-tformat-with-z' into maint
Junio C Hamano [Mon, 14 May 2012 18:42:34 +0000 (11:42 -0700)]
Merge branch 'jk/maint-tformat-with-z' into maint

By Jan Krüger (1) and Junio C Hamano (1)
* jk/maint-tformat-with-z:
  log-tree: the previous one is still not quite right
  log-tree: use custom line terminator in line termination mode

12 years agoMerge branch 'js/checkout-detach-count' into maint
Junio C Hamano [Mon, 14 May 2012 18:42:22 +0000 (11:42 -0700)]
Merge branch 'js/checkout-detach-count' into maint

When checking out another commit from an already detached state, we used
to report all commits that are not reachable from any of the refs as
lossage, but some of them might be reachable from the new HEAD, and there
is no need to warn about them.

By Johannes Sixt
* js/checkout-detach-count:
  checkout (detached): truncate list of orphaned commits at the new HEAD
  t2020-checkout-detach: check for the number of orphaned commits

12 years agoMerge branch 'ef/maint-clone-progress-fix' into maint
Junio C Hamano [Mon, 14 May 2012 18:41:40 +0000 (11:41 -0700)]
Merge branch 'ef/maint-clone-progress-fix' into maint

Some time ago, "git clone" lost the progress output for its "checkout"
phase; when run without any "--quiet" option, it should give progress to
the lengthy operation.

By Erik Faye-Lund
* ef/maint-clone-progress-fix:
  clone: fix progress-regression

12 years agolink to gitmodules page at the beginning of git-submodule documentation
Heiko Voigt [Mon, 14 May 2012 17:32:08 +0000 (19:32 +0200)]
link to gitmodules page at the beginning of git-submodule documentation

This way the user does not have to scroll down to the bottom to find
it.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agopack-protocol: fix first-want separator in the examples
Carlos Martín Nieto [Fri, 11 May 2012 23:44:53 +0000 (01:44 +0200)]
pack-protocol: fix first-want separator in the examples

When sending the "want" list, the capabilities list is separated from
the obj-id by a SP instead of NUL as in the ref advertisement. The
text is correct, but the examples wrongly show the separator as
NUL. Fix the example so it uses SP.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agol10n: zh_CN.po: translate 1 new message
Jiang Xin [Tue, 8 May 2012 08:14:32 +0000 (16:14 +0800)]
l10n: zh_CN.po: translate 1 new message

Translate new message '[new ref]' since git 1.7.10.1.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
12 years agoGit 1.7.10.2 v1.7.10.2
Junio C Hamano [Fri, 11 May 2012 18:25:28 +0000 (11:25 -0700)]
Git 1.7.10.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jc/diff-algo-cleanup' into maint
Junio C Hamano [Fri, 11 May 2012 18:19:27 +0000 (11:19 -0700)]
Merge branch 'jc/diff-algo-cleanup' into maint

* jc/diff-algo-cleanup:
  xdiff: PATIENCE/HISTOGRAM are not independent option bits
  xdiff: remove XDL_PATCH_* macros

12 years agoMerge branch 'ct/advise-push-default' into maint
Junio C Hamano [Fri, 11 May 2012 18:18:43 +0000 (11:18 -0700)]
Merge branch 'ct/advise-push-default' into maint

The cases "git push" fails due to non-ff can be broken into three
categories; each case is given a separate advise message.

By Christopher Tiwald (2) and Jeff King (1)
* ct/advise-push-default:
  Fix httpd tests that broke when non-ff push advice changed
  clean up struct ref's nonfastforward field
  push: Provide situational hints for non-fast-forward errors

12 years agoMerge branch 'js/fast-import-test-9300' into maint
Junio C Hamano [Fri, 11 May 2012 18:17:49 +0000 (11:17 -0700)]
Merge branch 'js/fast-import-test-9300' into maint

By Johannes Sixt
* js/fast-import-test-9300:
  t9300-fast-import: avoid 'exit' in test_expect_success snippets

12 years agoMerge branch 'jk/repack-no-explode-objects-from-old-pack' into maint
Junio C Hamano [Fri, 11 May 2012 18:16:45 +0000 (11:16 -0700)]
Merge branch 'jk/repack-no-explode-objects-from-old-pack' into maint

"git repack" used to write out unreachable objects as loose objects
when repacking, even if such loose objects will immediately pruned
due to its age.

By Jeff King
* jk/repack-no-explode-objects-from-old-pack:
  gc: use argv-array for sub-commands
  argv-array: add a new "pushl" method
  argv-array: refactor empty_argv initialization
  gc: do not explode objects which will be immediately pruned

12 years agoMerge branch 'ah/maint-grep-double-init' into maint
Junio C Hamano [Fri, 11 May 2012 18:16:09 +0000 (11:16 -0700)]
Merge branch 'ah/maint-grep-double-init' into maint

By Angus Hammond
* ah/maint-grep-double-init:
  grep.c: remove redundant line of code

12 years agoMerge branch 'fa/maint-config-doc' into maint
Junio C Hamano [Fri, 11 May 2012 18:15:53 +0000 (11:15 -0700)]
Merge branch 'fa/maint-config-doc' into maint

By Florian Achleitner
* fa/maint-config-doc:
  Documentation/git-config: describe and clarify "--local <file>" option

12 years agoMerge branch 'rs/unpack-trees-leakfix' into maint
Junio C Hamano [Fri, 11 May 2012 18:15:10 +0000 (11:15 -0700)]
Merge branch 'rs/unpack-trees-leakfix' into maint

By René Scharfe
* rs/unpack-trees-leakfix:
  unpack-trees: plug minor memory leak
  unpack-trees: don't perform any index operation if we're not merging

12 years agoMerge branch 'sl/test-wc-l-line-count' into maint
Junio C Hamano [Fri, 11 May 2012 18:14:57 +0000 (11:14 -0700)]
Merge branch 'sl/test-wc-l-line-count' into maint

By Stefano Lattarini
* sl/test-wc-l-line-count:
  tests: modernise style: more uses of test_line_count

12 years agoMerge branch 'rl/show-empty-prefix' into maint
Junio C Hamano [Fri, 11 May 2012 18:13:26 +0000 (11:13 -0700)]
Merge branch 'rl/show-empty-prefix' into maint

Unlike "git rev-parse --show-cdup", "--show-prefix" did not give an
empty line when run at the top of the working tree.

By Ross Lagerwall
* rl/show-empty-prefix:
  rev-parse --show-prefix: add in trailing newline

12 years agodocument submdule.$name.update=none option for gitmodules
Heiko Voigt [Thu, 10 May 2012 18:59:04 +0000 (20:59 +0200)]
document submdule.$name.update=none option for gitmodules

This option was not yet described in the gitmodules documentation. We
only described it in the 'git submodule' command documentation but
gitmodules is the more natural place to look.

A short reference in the 'git submodule' documentation should be
sufficient since the details can now be found in the documentation to
gitmodules.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoUpdate draft release notes to 1.7.10.2
Junio C Hamano [Thu, 10 May 2012 17:45:42 +0000 (10:45 -0700)]
Update draft release notes to 1.7.10.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'mm/include-userpath' into maint
Junio C Hamano [Thu, 10 May 2012 17:33:05 +0000 (10:33 -0700)]
Merge branch 'mm/include-userpath' into maint

By Jeff King
* mm/include-userpath:
  config: expand tildes in include.path variable

12 years agoMerge branch 'cc/fix-missing-va-end-in-revert' into maint
Junio C Hamano [Thu, 10 May 2012 17:32:43 +0000 (10:32 -0700)]
Merge branch 'cc/fix-missing-va-end-in-revert' into maint

By Christian Couder
* cc/fix-missing-va-end-in-revert:
  revert: add missing va_end

12 years agoMerge branch 'bw/test-fix-grep-gnuism' into maint
Junio C Hamano [Thu, 10 May 2012 17:32:15 +0000 (10:32 -0700)]
Merge branch 'bw/test-fix-grep-gnuism' into maint

* bw/test-fix-grep-gnuism:
  t9400: fix gnuism in grep

12 years agoMerge branch 'jk/http-backend-keep-committer-ident-env' into maint
Junio C Hamano [Thu, 10 May 2012 17:29:50 +0000 (10:29 -0700)]
Merge branch 'jk/http-backend-keep-committer-ident-env' into maint

By Jeff King
* jk/http-backend-keep-committer-ident-env:
  http-backend: respect existing GIT_COMMITTER_* variables

Conflicts:
t/t5541-http-push.sh

12 years agoMerge branch 'nl/rebase-i-cheat-sheet' into maint
Junio C Hamano [Thu, 10 May 2012 17:29:14 +0000 (10:29 -0700)]
Merge branch 'nl/rebase-i-cheat-sheet' into maint

* nl/rebase-i-cheat-sheet:
  rebase -i: remind that the lines are top-to-bottom

12 years agoMerge branch 'bw/submodule-sed-solaris' into maint
Junio C Hamano [Thu, 10 May 2012 17:27:58 +0000 (10:27 -0700)]
Merge branch 'bw/submodule-sed-solaris' into maint

By Ben Walton
* bw/submodule-sed-solaris:
  Avoid bug in Solaris xpg4/sed as used in submodule

12 years agoMerge branch 'jk/maint-push-progress' into maint
Junio C Hamano [Thu, 10 May 2012 17:08:54 +0000 (10:08 -0700)]
Merge branch 'jk/maint-push-progress' into maint

"git push" over smart-http lost progress output a few releases ago.

By Jeff King
* jk/maint-push-progress:
  t5541: test more combinations of --progress
  teach send-pack about --[no-]progress
  send-pack: show progress when isatty(2)

12 years agoMerge branch 'jc/rerere-train' into maint
Junio C Hamano [Thu, 10 May 2012 17:08:24 +0000 (10:08 -0700)]
Merge branch 'jc/rerere-train' into maint

A contrib script "rerere-train" did not work out of the box unless user
futzed with her $PATH.

* jc/rerere-train:
  contrib/rerere-train: use installed git-sh-setup

12 years agoMerge branch 'lp/diffstat-with-graph' into maint
Junio C Hamano [Thu, 10 May 2012 17:06:52 +0000 (10:06 -0700)]
Merge branch 'lp/diffstat-with-graph' into maint

"log --graph" was not very friendly with "--stat" option and its output
had line breaks at wrong places.

By Lucian Poston (5) and Zbigniew Jędrzejewski-Szmek (3)
* lp/diffstat-with-graph:
  t4052: work around shells unable to set COLUMNS to 1
  test-lib: skip test with COLUMNS=1 under mksh
  Prevent graph_width of stat width from falling below min
  t4052: Test diff-stat output with minimum columns
  t4052: Adjust --graph --stat output for prefixes
  Adjust stat width calculations to take --graph output into account
  Add output_prefix_length to diff_options
  t4052: test --stat output with --graph

12 years agocheckout: do not corrupt HEAD on empty repo
Erik Faye-Lund [Tue, 8 May 2012 17:22:33 +0000 (19:22 +0200)]
checkout: do not corrupt HEAD on empty repo

In abe1998 ("git checkout -b: allow switching out of an unborn
branch"), a code-path overly-optimisticly assumed that a
branch-name was specified. This is not always the case, and as
a result a NULL-pointer was attempted printed to .git/HEAD.

This could lead to at least two different failure modes:
 1) vsnprintf formated the NULL-string as something useful (e.g
    "(null)")
 2) vsnprintf crashed

Neither were very convenient for formatting a new HEAD-reference.

To fix this, reintroduce some strictness so we only take this
new codepath if a banch-name was specified.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agol10n: de.po: translate one new message
Ralf Thielow [Tue, 8 May 2012 17:03:30 +0000 (19:03 +0200)]
l10n: de.po: translate one new message

Translate one new messages came from git.pot
update in 7795e42 (l10n: Update git.pot (1 new messages)).
It also updates and reformats the de.po file due to "msgmerge".

Signed-off-by: Ralf Thielow <ralf.thielow@googlemail.com>
12 years agol10n: de.po: unify translation of "ahead" and "behind"
Ralf Thielow [Fri, 4 May 2012 18:54:44 +0000 (20:54 +0200)]
l10n: de.po: unify translation of "ahead" and "behind"

Signed-off-by: Ralf Thielow <ralf.thielow@googlemail.com>
12 years agol10n: de.po: collection of improvements
Ralf Thielow [Fri, 4 May 2012 18:28:08 +0000 (20:28 +0200)]
l10n: de.po: collection of improvements

A list of improvements for German translation
which contains a couple of spellings and grammar.

Signed-off-by: Ralf Thielow <ralf.thielow@googlemail.com>
12 years agol10n: de.po: translate "remote" as "extern"
Ralf Thielow [Fri, 4 May 2012 16:59:53 +0000 (18:59 +0200)]
l10n: de.po: translate "remote" as "extern"

The word "remote" was translated as "entfernt"
and "anders". Both of them aren't really good
because "anders" in German means "other" and
"entfernt" has two different meanings and could
result in confusion to the users.
We've changed the translation to "extern".

Suggested-by: Jan Krüger <jk@jk.gs>
Signed-off-by: Ralf Thielow <ralf.thielow@googlemail.com>
12 years agol10n: de.po: translate "track" as "beobachten"
Ralf Thielow [Fri, 4 May 2012 16:27:54 +0000 (18:27 +0200)]
l10n: de.po: translate "track" as "beobachten"

The word "track" was translated as "verfolgen"
and "folgen". We've decided to translate "track" in
the meaning of tracked files/content as "beobachten"
and in the remote-tracking sense as "folgen".

Suggested-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Ralf Thielow <ralf.thielow@googlemail.com>
12 years agol10n: add new members to German translation team
Ralf Thielow [Fri, 4 May 2012 18:47:35 +0000 (20:47 +0200)]
l10n: add new members to German translation team

Add Thomas Rast, Jan Krüger and Christian Stimming
to German translation team.

Signed-off-by: Ralf Thielow <ralf.thielow@googlemail.com>
12 years agol10n: de.po: collection of suggestions
Thomas Rast [Wed, 2 May 2012 13:49:27 +0000 (15:49 +0200)]
l10n: de.po: collection of suggestions

A long list of suggested changes to the translation.  None of them are
clear-cut, though I of course think they are an improvement ;-)

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Ralf Thielow <ralf.thielow@googlemail.com>
12 years agol10n: de.po: translate "bad" as "ungültig" ("invalid")
Thomas Rast [Wed, 2 May 2012 13:49:26 +0000 (15:49 +0200)]
l10n: de.po: translate "bad" as "ungültig" ("invalid")

"schlecht" doesn't quite sound right to me, especially in messages
like "bad object" where the object doesn't even exist in the first
place.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Ralf Thielow <ralf.thielow@googlemail.com>
12 years agol10n: de.po: hopefully uncontroversial fixes
Thomas Rast [Wed, 2 May 2012 13:49:25 +0000 (15:49 +0200)]
l10n: de.po: hopefully uncontroversial fixes

These are all obviously wrong, such as typos or messages where the
current translation is based on a misunderstanding of the original
message.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Ralf Thielow <ralf.thielow@googlemail.com>
12 years agol10n: de.po: translate "bare" as "bloß"
Thomas Rast [Wed, 2 May 2012 17:27:03 +0000 (19:27 +0200)]
l10n: de.po: translate "bare" as "bloß"

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Ralf Thielow <ralf.thielow@googlemail.com>
12 years agostatus: respect "-b" for porcelain format
Jeff King [Mon, 7 May 2012 21:09:04 +0000 (17:09 -0400)]
status: respect "-b" for porcelain format

There is no reason not to, as the user has to explicitly ask
for it, so we are not breaking compatibility by doing so. We
can do this simply by moving the "show_branch" flag into
the wt_status struct. As a bonus, this saves us from passing
it explicitly, simplifying the code.

Signed-off-by: Jeff King <peff@peff.net>
12 years agostatus: fix null termination with "-b"
Jeff King [Mon, 7 May 2012 21:02:18 +0000 (17:02 -0400)]
status: fix null termination with "-b"

When the "-z" option is given to status, we are supposed to
NUL-terminate each record. However, the "-b" code to show
the tracking branch did not respect this, and always ended
with a newline.

Signed-off-by: Jeff King <peff@peff.net>
12 years agostatus: refactor null_termination option
Jeff King [Mon, 7 May 2012 19:44:44 +0000 (15:44 -0400)]
status: refactor null_termination option

This option is passed separately to the wt_status printing
functions, whereas every other formatting option is
contained in the wt_status struct itself. Let's do the same
here, so we can avoid passing it around through the call
stack.

Signed-off-by: Jeff King <peff@peff.net>
12 years agocommit: refactor option parsing
Jeff King [Mon, 7 May 2012 19:18:26 +0000 (15:18 -0400)]
commit: refactor option parsing

The options are declared as a static global, but really they
need only be accessible from cmd_commit.  Additionally,
declare the "struct wt_status" in cmd_commit and cmd_status
as static at the top of each function; this will let the
options lists reference them directly, which will facilitate
further cleanups.

Signed-off-by: Jeff King <peff@peff.net>
12 years agol10n: Update git.pot (1 new messages)
Jiang Xin [Tue, 8 May 2012 07:49:57 +0000 (15:49 +0800)]
l10n: Update git.pot (1 new messages)

Changes of po/git.pot from v1.7.10.1 to v1.7.10.1-36-g42325:

 * 1 new l10n message at line: 1761

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
12 years agoDocumentation/git-config: describe and clarify "--local <file>" option
Florian Achleitner [Sat, 5 May 2012 10:03:52 +0000 (12:03 +0200)]
Documentation/git-config: describe and clarify "--local <file>" option

Describe config file selection in git-config.  While the usage message of
git-config shows --local, the documentation page did not contain anything
about that.

Signed-off-by: Florian Achleitner <florian.achleitner.2.6.31@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoreflog-walk: tell explicit --date=default from not having --date at all
Junio C Hamano [Mon, 7 May 2012 21:11:32 +0000 (14:11 -0700)]
reflog-walk: tell explicit --date=default from not having --date at all

Introduction of opt->date_mode_explicit was a step in the right direction,
but lost that crucial bit at the very end of the callchain, and the callee
could not tell an explicitly specified "I want *date* but in default format"
from the built-in default value passed when there was no --date specified.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoStart preparing for 1.7.10.2
Junio C Hamano [Mon, 7 May 2012 20:24:13 +0000 (13:24 -0700)]
Start preparing for 1.7.10.2

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