Code

git.git
17 years agoSimplify strchrnul() compat code
Andreas Ericsson [Sat, 10 Nov 2007 11:55:48 +0000 (12:55 +0100)]
Simplify strchrnul() compat code

strchrnul() was introduced in glibc in April 1999 and included in
glibc-2.1. Checking for that version means the majority of all git
users would get to use the optimized version in glibc. Of the
remaining few some might get to use a slightly slower version
than necessary but probably not slower than what we have today.

Unfortunately, __GLIBC_PREREQ() macro was not available in glibc 2.1.1
which was short lived but already supported strchrnul().  Odd minority
users of that library needs to live with our compatibility inline version.

Rediffed-against-next-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years ago--format=pretty: avoid calculating expensive expansions twice
René Scharfe [Sat, 10 Nov 2007 11:18:26 +0000 (12:18 +0100)]
--format=pretty: avoid calculating expensive expansions twice

As Jeff King remarked, format strings with duplicate placeholders can
be slow to expand, because each instance is calculated anew.

This patch makes use of the fact that format_commit_message() and its
helper functions only ever add stuff to the end of the strbuf.  For
certain expensive placeholders, store the offset and length of their
expansion with the strbuf at the first occurrence.  Later they
expansion result can simply be copied from there -- no malloc() or
strdup() required.

These certain placeholders are the abbreviated commit, tree and
parent hashes, as the search for a unique abbreviated hash is quite
costly.  Here are the times for next (best of three runs):

$ time git log --pretty=format:%h >/dev/null

real    0m0.611s
user    0m0.404s
sys     0m0.204s

$ time git log --pretty=format:%h%h%h%h >/dev/null

real    0m1.206s
user    0m0.744s
sys     0m0.452s

And here those with this patch (and the previous two); the speedup
of the single placeholder case is just noise:

$ time git log --pretty=format:%h >/dev/null

real    0m0.608s
user    0m0.416s
sys     0m0.192s

$ time git log --pretty=format:%h%h%h%h >/dev/null

real    0m0.639s
user    0m0.488s
sys     0m0.140s

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoadd strbuf_adddup()
René Scharfe [Sat, 10 Nov 2007 11:16:05 +0000 (12:16 +0100)]
add strbuf_adddup()

Add a new function, strbuf_adddup(), that appends a duplicate of a
part of a struct strbuf to end of the latter.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years ago--pretty=format: parse commit message only once
René Scharfe [Sat, 10 Nov 2007 11:14:20 +0000 (12:14 +0100)]
--pretty=format: parse commit message only once

As Jeff King pointed out, some placeholder expansions are related to
each other: the steps to calculate one go most of the way towards
calculating the other, too.

This patch makes format_commit_message() parse the commit message
only once, remembering the position of each item.  This speeds up
handling of format strings containing multiple placeholders from the
set %s, %a*, %c*, %e, %b.

Here are the timings for the git version in next.  The first one is
to estimate the overhead of the caching, the second one is taken
from http://svn.tue.mpg.de/tentakel/trunk/tentakel/Makefile as an
example of a format string found in the wild.  The times are the
fastest of three consecutive runs in each case:

$ time git log --pretty=format:%e >/dev/null

real    0m0.381s
user    0m0.340s
sys     0m0.024s

$ time git log --pretty=format:"* %cd %cn%n%n%s%n%b" >/dev/null

real    0m0.623s
user    0m0.556s
sys     0m0.052s

And here the times with this patch:

$ time git log --pretty=format:%e >/dev/null

real    0m0.385s
user    0m0.332s
sys     0m0.040s

$ time git log --pretty=format:"* %cd %cn%n%n%s%n%b" >/dev/null

real    0m0.563s
user    0m0.504s
sys     0m0.048s

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years ago--pretty=format: on-demand format expansion
René Scharfe [Fri, 9 Nov 2007 00:49:42 +0000 (01:49 +0100)]
--pretty=format: on-demand format expansion

Some of the --pretty=format placeholders expansions are expensive to
calculate.  This is made worse by the current code's use of
interpolate(), which requires _all_ placeholders are to be prepared
up front.

One way to speed this up is to check which placeholders are present
in the format string and to prepare only the expansions that are
needed.  That still leaves the allocation overhead of interpolate().

Another way is to use a callback based approach together with the
strbuf library to keep allocations to a minimum and avoid string
copies.  That's what this patch does.  It introduces a new strbuf
function, strbuf_expand().

The function takes a format string, list of placeholder strings,
a user supplied function 'fn', and an opaque pointer 'context'
to tell 'fn' what thingy to operate on.

The function 'fn' is expected to accept a strbuf, a parsed
placeholder string and the 'context' pointer, and append the
interpolated value for the 'context' thingy, according to the
format specified by the placeholder.

Thanks to Pierre Habouzit for his suggestion to use strchrnul() and
the code surrounding its callsite.  And thanks to Junio for most of
this commit message. :)

Here my measurements of most of Paul Mackerras' test cases that
highlighted the performance problem (best of three runs):

(master)
$ time git log --pretty=oneline >/dev/null

real    0m0.390s
user    0m0.340s
sys     0m0.040s

(master)
$ time git log --pretty=raw >/dev/null

real    0m0.434s
user    0m0.408s
sys     0m0.016s

(master)
$ time git log --pretty="format:%H {%P} %ct" >/dev/null

real    0m1.347s
user    0m0.080s
sys     0m1.256s

(interp_find_active -- Dscho)
$ time ./git log --pretty="format:%H {%P} %ct" >/dev/null

real    0m0.694s
user    0m0.020s
sys     0m0.672s

(strbuf_expand -- this patch)
$ time ./git log --pretty="format:%H {%P} %ct" >/dev/null

real    0m0.395s
user    0m0.352s
sys     0m0.028s

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoAdd strchrnul()
René Scharfe [Fri, 9 Nov 2007 00:49:36 +0000 (01:49 +0100)]
Add strchrnul()

As suggested by Pierre Habouzit, add strchrnul().  It's a useful GNU
extension and can simplify string parser code.  There are several
places in git that can be converted to strchrnul(); as a trivial
example, this patch introduces its usage to builtin-fetch--tool.c.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoUpdate draft release notes for 1.5.4
Junio C Hamano [Fri, 9 Nov 2007 08:32:38 +0000 (00:32 -0800)]
Update draft release notes for 1.5.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'maint'
Junio C Hamano [Fri, 9 Nov 2007 08:21:44 +0000 (00:21 -0800)]
Merge branch 'maint'

* maint:
  Start preparing for 1.5.3.6
  git-send-email: Change the prompt for the subject of the initial message.
  SubmittingPatches: improve the 'Patch:' section of the checklist
  instaweb: Minor cleanups and fixes for potential problems
  stop t1400 hiding errors in tests
  Makefile: add missing dependency on wt-status.h
  refresh_index_quietly(): express "optional" nature of index writing better
  Fix sed string regex escaping in module_name.
  Avoid a few unportable, needlessly nested "...`...".
  git-mailsplit: with maildirs not only process cur/, but also new/

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-bisect.sh: Fix sed script to work with AIX and BSD sed.
Ralf Wildenhues [Thu, 8 Nov 2007 21:48:24 +0000 (22:48 +0100)]
git-bisect.sh: Fix sed script to work with AIX and BSD sed.

\n is not portable in a s/// replacement string, only
in the regex part.  backslash-newline helps.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoStart preparing for 1.5.3.6
Junio C Hamano [Fri, 9 Nov 2007 08:17:26 +0000 (00:17 -0800)]
Start preparing for 1.5.3.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-send-email: Change the prompt for the subject of the initial message.
Benoit Sigoure [Thu, 8 Nov 2007 18:56:28 +0000 (19:56 +0100)]
git-send-email: Change the prompt for the subject of the initial message.

I never understood what this prompt was asking for until I read the actual
source code.  I think this wording is much more understandable.

Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoSubmittingPatches: improve the 'Patch:' section of the checklist
Sergei Organov [Thu, 8 Nov 2007 16:40:25 +0000 (19:40 +0300)]
SubmittingPatches: improve the 'Patch:' section of the checklist

There were 2 items "send patch to..." but having different set of
addresses to send patch to. Merge them together and move the resulting
item to the end of checklist.

Signed-off-by: Sergei Organov <osv@javad.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoinstaweb: Minor cleanups and fixes for potential problems
Jonas Fonseca [Thu, 8 Nov 2007 23:21:42 +0000 (00:21 +0100)]
instaweb: Minor cleanups and fixes for potential problems

Fix path quoting and test of empty values that some shells do not like.
Remove duplicate check and setting of $browser.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agostop t1400 hiding errors in tests
Alex Riesen [Thu, 8 Nov 2007 23:41:39 +0000 (00:41 +0100)]
stop t1400 hiding errors in tests

The last rm in the test was lacking an "&&" before it,
which caused the errors in the commands be silently hidden.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMakefile: add missing dependency on wt-status.h
Junio C Hamano [Fri, 9 Nov 2007 00:41:56 +0000 (16:41 -0800)]
Makefile: add missing dependency on wt-status.h

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agorefresh_index_quietly(): express "optional" nature of index writing better
Junio C Hamano [Fri, 9 Nov 2007 00:24:00 +0000 (16:24 -0800)]
refresh_index_quietly(): express "optional" nature of index writing better

The point of the part of the code this patch touches is that if
we modified the active_cache, we try to write it out and make it
the index file for later users to use by calling
"commit_locked_index", but we do not really care about the
failure from this sequence because it is done purely as an
optimization.

The original code called three functions primarily for their
side effects but as condition of an if statement, which is
admittedly a bad style.

Incidentally, it squelches an "empty if body" warning from gcc.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoFix sed string regex escaping in module_name.
Ralf Wildenhues [Thu, 8 Nov 2007 21:48:49 +0000 (22:48 +0100)]
Fix sed string regex escaping in module_name.

When escaping a string to be used as a sed regex, it is important
to only escape active characters.  Escaping other characters is
undefined according to POSIX, and in practice leads to issues with
extensions such as GNU sed's \+.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoAvoid a few unportable, needlessly nested "...`...".
Ralf Wildenhues [Thu, 8 Nov 2007 21:47:36 +0000 (22:47 +0100)]
Avoid a few unportable, needlessly nested "...`...".

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoStyle: place opening brace of a function definition at column 1
Junio C Hamano [Thu, 8 Nov 2007 23:35:32 +0000 (15:35 -0800)]
Style: place opening brace of a function definition at column 1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agocontrib/hooks/post-receive-email: remove cruft, $committer is not used
Gerrit Pape [Thu, 8 Nov 2007 12:11:57 +0000 (12:11 +0000)]
contrib/hooks/post-receive-email: remove cruft, $committer is not used

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agohooks--update: decline deleting tags or branches by default, add config options
Gerrit Pape [Thu, 8 Nov 2007 09:47:39 +0000 (09:47 +0000)]
hooks--update: decline deleting tags or branches by default, add config options

Decline deleting tags or branches through git push <remote> :<ref> by
default, support config options hooks.allowdeletetag, hooks.allowdeletebranch
to override this per repository.

Before this patch the update hook interpreted deleting a tag, no matter if
annotated or not, through git push <remote> :<tag> as unannotated tag, and
declined it by default, but with an unappropriate error message:

 $ git push origin :atag
 deleting 'refs/tags/atag'
 *** The un-annotated tag, atag, is not allowed in this repository
 *** Use 'git tag [ -a | -s ]' for tags you want to propagate.
 ng refs/tags/atag hook declined
 error: hooks/update exited with error code 1
 error: hook declined to update refs/tags/atag
 error: failed to push to 'monolith:/git/qm/test-repo'

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agohooks--update: fix test for properly set up project description file
Gerrit Pape [Thu, 8 Nov 2007 14:02:00 +0000 (14:02 +0000)]
hooks--update: fix test for properly set up project description file

The update hook template intends to abort if the project description file
hasn't been adjusted or is empty.  This patch fixes the check for 'being
adjusted'.

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-mailsplit: with maildirs not only process cur/, but also new/
Gerrit Pape [Tue, 6 Nov 2007 08:54:18 +0000 (08:54 +0000)]
git-mailsplit: with maildirs not only process cur/, but also new/

When saving patches to a maildir with e.g. mutt, the files are put into
the new/ subdirectory of the maildir, not cur/.  This makes git-am state
"Nothing to do.".  This patch lets git-mailsplit additional check new/
after reading cur/.

This was reported by Joey Hess through
 http://bugs.debian.org/447396

Signed-off-by: Gerrit Pape <pape@smarden.org>
Acked-by: Jeff King <peff@peff.net>
Acked-by: Alex Riesen <raa.lkml@gmail.com>
Acked-by: Fernando J. Pereda <ferdy@gentoo.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'jc/clean-config'
Junio C Hamano [Thu, 8 Nov 2007 02:19:38 +0000 (18:19 -0800)]
Merge branch 'jc/clean-config'

* jc/clean-config:
  clean: require -f to do damage by default

17 years agoMerge branch 'gp/reset-q'
Junio C Hamano [Thu, 8 Nov 2007 02:18:55 +0000 (18:18 -0800)]
Merge branch 'gp/reset-q'

* gp/reset-q:
  git-reset: add -q option to operate quietly

17 years agoMerge branch 'ds/maint-deflatebound'
Junio C Hamano [Thu, 8 Nov 2007 02:17:20 +0000 (18:17 -0800)]
Merge branch 'ds/maint-deflatebound'

* ds/maint-deflatebound:
  Improve accuracy of check for presence of deflateBound.

17 years agoMerge branch 'cp/p4'
Junio C Hamano [Thu, 8 Nov 2007 02:16:18 +0000 (18:16 -0800)]
Merge branch 'cp/p4'

* cp/p4:
  git-p4: Detect changes to executable bit and include them in p4 submit.
  git-p4: Add a helper function to parse the full git diff-tree output.

17 years agoMerge branch 'maint'
Junio C Hamano [Thu, 8 Nov 2007 02:07:07 +0000 (18:07 -0800)]
Merge branch 'maint'

* maint:
  Add Documentation/CodingGuidelines
  When exec() fails include the failing command in the error message
  RelNotes-1.5.3.5: fix another typo

17 years agoMerge branch 'mh/work-tree'
Junio C Hamano [Thu, 8 Nov 2007 01:37:00 +0000 (17:37 -0800)]
Merge branch 'mh/work-tree'

* mh/work-tree:
  Make git-blame fail when working tree is needed and we're not in one
  Don't always require working tree for git-rm
  Use setup_work_tree() in builtin-ls-files.c
  Refactor working tree setup

17 years agoSmall code readability improvement in show_reference() in builtin-tag.c
Mike Hommey [Sat, 3 Nov 2007 13:08:05 +0000 (14:08 +0100)]
Small code readability improvement in show_reference() in builtin-tag.c

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agosend-email: apply --suppress-from to S-o-b and cc-cmd
Uwe Kleine-König [Wed, 7 Nov 2007 07:34:12 +0000 (08:34 +0100)]
send-email: apply --suppress-from to S-o-b and cc-cmd

Signed-off-by: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
Cc: Ryan Anderson <ryan@michonline.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoFix minor nits in configure.ac
Ralf Wildenhues [Tue, 6 Nov 2007 20:12:45 +0000 (21:12 +0100)]
Fix minor nits in configure.ac

Avoid "test -o" as it is only XSI not POSIX, and not portable.
Avoid exit(3) in test programs in favor of return, to accommodate
for newer Autoconf not providing a declaration for exit.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoDeprecate git-lost-found
Johannes Schindelin [Thu, 8 Nov 2007 00:41:22 +0000 (00:41 +0000)]
Deprecate git-lost-found

"git fsck" learnt the option "--lost-found" in v1.5.3-rc0~5, to make
"git lost-found" obsolete.  It is time to deprecate "git lost-found".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoImprove accuracy of check for presence of deflateBound.
David Symonds [Wed, 7 Nov 2007 03:24:28 +0000 (14:24 +1100)]
Improve accuracy of check for presence of deflateBound.

ZLIB_VERNUM isn't defined in some zlib versions, so this patch does a proper
linking test in autoconf to see whether deflateBound exists in zlib. Also,
setting NO_DEFLATE_BOUND will also work for folk not using autoconf.

Signed-off-by: David Symonds <dsymonds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoAdd Documentation/CodingGuidelines
Johannes Schindelin [Thu, 8 Nov 2007 00:33:19 +0000 (00:33 +0000)]
Add Documentation/CodingGuidelines

Even if our code is quite a good documentation for our coding style,
some people seem to prefer a document describing it.

The part about the shell scripts is clearly just copied from one of
Junio's helpful mails, and some parts were added from comments by
Junio, Andreas Ericsson and Robin Rosenberg.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agocontrib/hooks/post-receive-email: make subject prefix configurable
Gerrit Pape [Tue, 6 Nov 2007 13:49:30 +0000 (13:49 +0000)]
contrib/hooks/post-receive-email: make subject prefix configurable

Email subjects are prefixed with "[SCM] " by default, make this optionally
configurable through the hooks.emailprefix config option.

Suggested by martin f krafft through
 http://bugs.debian.org/428418

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agocontrib/hooks/post-receive-email: reformat to wrap comments at 76 chars
Gerrit Pape [Tue, 6 Nov 2007 13:48:34 +0000 (13:48 +0000)]
contrib/hooks/post-receive-email: reformat to wrap comments at 76 chars

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agocontrib/hooks/post-receive-email: fix typo
Gerrit Pape [Tue, 6 Nov 2007 13:48:07 +0000 (13:48 +0000)]
contrib/hooks/post-receive-email: fix typo

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agorestore fetching with thin-pack capability
Nicolas Pitre [Wed, 7 Nov 2007 22:20:22 +0000 (17:20 -0500)]
restore fetching with thin-pack capability

Broken since commit fa74052922cf39e5a39ad7178d1b13c2da9b4519.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoWhen exec() fails include the failing command in the error message
Ask Bjørn Hansen [Tue, 6 Nov 2007 10:54:01 +0000 (02:54 -0800)]
When exec() fails include the failing command in the error message

git-svn occasionally fails with no details as to what went wrong - this should help debug those situations.

Signed-off-by: Ask Bjørn Hansen <ask@develooper.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoRelNotes-1.5.3.5: fix another typo
David D Kilzer [Sun, 4 Nov 2007 12:45:22 +0000 (04:45 -0800)]
RelNotes-1.5.3.5: fix another typo

Signed-off-by: David D Kilzer <ddkilzer@kilzer.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-reset: add -q option to operate quietly
Gerrit Pape [Sun, 4 Nov 2007 09:37:20 +0000 (09:37 +0000)]
git-reset: add -q option to operate quietly

Many git commands have a -q option to suppress output to stdout, let's
have it for git-reset too.

This was asked for by Joey Hess through
 http://bugs.debian.org/444933

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMake git-blame fail when working tree is needed and we're not in one
Mike Hommey [Sat, 3 Nov 2007 12:22:55 +0000 (13:22 +0100)]
Make git-blame fail when working tree is needed and we're not in one

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoDon't always require working tree for git-rm
Mike Hommey [Sat, 3 Nov 2007 11:23:13 +0000 (12:23 +0100)]
Don't always require working tree for git-rm

This allows to do git rm --cached -r directory, instead of
git ls-files -z directory | git update-index --remove -z --stdin.
This can be particularly useful for git-filter-branch users.

Signed-off-by: Mike Hommey <mh@glandium.org>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoUse setup_work_tree() in builtin-ls-files.c
Mike Hommey [Sat, 3 Nov 2007 11:23:12 +0000 (12:23 +0100)]
Use setup_work_tree() in builtin-ls-files.c

Signed-off-by: Mike Hommey <mh@glandium.org>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoRefactor working tree setup
Mike Hommey [Sat, 3 Nov 2007 11:23:11 +0000 (12:23 +0100)]
Refactor working tree setup

Create a setup_work_tree() that can be used from any command requiring
a working tree conditionally.

Signed-off-by: Mike Hommey <mh@glandium.org>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'maint'
Junio C Hamano [Tue, 6 Nov 2007 06:03:47 +0000 (22:03 -0800)]
Merge branch 'maint'

* maint:
  Remove a couple of duplicated include
  grep with unmerged index
  git-daemon: fix remote port number in log entry
  git-svn: t9114: verify merge commit message in test
  git-svn: fix dcommit clobbering when committing a series of diffs

17 years agoFix comment in strbuf.h to use correct name strbuf_avail()
Steffen Prohaska [Sun, 4 Nov 2007 08:02:21 +0000 (09:02 +0100)]
Fix comment in strbuf.h to use correct name strbuf_avail()

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoRemove a couple of duplicated include
Marco Costalba [Sun, 4 Nov 2007 14:35:26 +0000 (15:35 +0100)]
Remove a couple of duplicated include

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogrep with unmerged index
Junio C Hamano [Tue, 6 Nov 2007 01:16:47 +0000 (17:16 -0800)]
grep with unmerged index

We called flush_grep() every time we saw an unmerged entry in
the index.  If we happen to find an unmerged entry before we saw
more than two paths, we incorrectly declared that the user had
too many non-paths options in front.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'gp/maint-diffdoc' into maint
Junio C Hamano [Tue, 6 Nov 2007 02:56:55 +0000 (18:56 -0800)]
Merge branch 'gp/maint-diffdoc' into maint

* gp/maint-diffdoc:
  git-diff.txt: add section "output format" describing the diff formats

17 years agoSome better parse-options documentation.
Pierre Habouzit [Mon, 5 Nov 2007 12:03:22 +0000 (13:03 +0100)]
Some better parse-options documentation.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-daemon: fix remote port number in log entry
Gerrit Pape [Mon, 5 Nov 2007 09:16:22 +0000 (09:16 +0000)]
git-daemon: fix remote port number in log entry

The port number in struct sockaddr_in needs to be converted from network
byte order to host byte order (on some architectures).

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogc: --prune prunes unreferenced objects.
Junio C Hamano [Tue, 6 Nov 2007 00:39:00 +0000 (16:39 -0800)]
gc: --prune prunes unreferenced objects.

Brandon Casey correctly points out that we repack with -A without --prune
and with -a with --prune, so it is not just unreferenced loose objects
that are pruned away when the option is given.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agot3502: Disambiguate between file and rev by adding --
Brian Gernhardt [Sun, 4 Nov 2007 15:31:26 +0000 (10:31 -0500)]
t3502: Disambiguate between file and rev by adding --

On a case insensitive file system, this test fails because git-diff
doesn't know if it is asking for the file "A" or the tag "a".

Adding "--" at the end of the ambiguous commands allows the test to
finish properly.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoAdd more tests for git-clean
Shawn Bohrer [Mon, 5 Nov 2007 04:28:12 +0000 (22:28 -0600)]
Add more tests for git-clean

Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoUse parseopts in builtin-push
Daniel Barkalow [Mon, 5 Nov 2007 03:35:37 +0000 (22:35 -0500)]
Use parseopts in builtin-push

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-svn: t9114: verify merge commit message in test
Eric Wong [Mon, 5 Nov 2007 11:21:48 +0000 (03:21 -0800)]
git-svn: t9114: verify merge commit message in test

It's possible that we end up with an incorrect commit message
in this test after making changes to fix the clobber bug
in dcommit.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-svn: fix dcommit clobbering when committing a series of diffs
Eric Wong [Mon, 5 Nov 2007 11:21:47 +0000 (03:21 -0800)]
git-svn: fix dcommit clobbering when committing a series of diffs

Our revision number sent to SVN is set to the last revision we
committed if we've made any previous commits in a dcommit
invocation.

Although our SVN Editor code uses the delta of two (old) trees
to generate information to send upstream, it'll still send
complete resultant files upstream; even if the tree they're
based against is out-of-date.

The combination of sending a file that does not include the
latest changes, but set with a revision number of a commit we
just made will cause SVN to accept the resultant file even if it
was generated against an old tree.

More trouble was caused when fixing this because we were
rebasing uncessarily at times.  We used git-diff-tree to check
the imported SVN revision against our HEAD, not the last tree we
committed to SVN.  The unnecessary rebasing caused merge commits
upstream to SVN to fail.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoSplit off the pretty print stuff into its own file
Johannes Schindelin [Sun, 4 Nov 2007 19:15:06 +0000 (19:15 +0000)]
Split off the pretty print stuff into its own file

The file commit.c got quite large, but it does not have to be: the
code concerning pretty printing is pretty well contained.  In fact,
this commit just splits it off into pretty.c, leaving commit.c with
just 672 lines.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoFix an infinite loop in sq_quote_buf().
Johannes Sixt [Sun, 4 Nov 2007 20:26:22 +0000 (21:26 +0100)]
Fix an infinite loop in sq_quote_buf().

sq_quote_buf() treats single-quotes and exclamation marks specially, but
it incorrectly parsed the input for single-quotes and backslashes.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoclean: require -f to do damage by default
Junio C Hamano [Fri, 2 Nov 2007 00:32:04 +0000 (17:32 -0700)]
clean: require -f to do damage by default

This makes the clean.requireForce configuration default to true.
Too many people are burned by typing "git clean" by mistake when
they meant to say "make clean".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'jc/format-patch-encoding'
Junio C Hamano [Sun, 4 Nov 2007 08:28:46 +0000 (01:28 -0700)]
Merge branch 'jc/format-patch-encoding'

* jc/format-patch-encoding:
  test format-patch -s: make sure MIME content type is shown as needed
  format-patch -s: add MIME encoding header if signer's name requires so

17 years agoMerge branch 'jc/revert-merge'
Junio C Hamano [Sun, 4 Nov 2007 08:26:02 +0000 (01:26 -0700)]
Merge branch 'jc/revert-merge'

* jc/revert-merge:
  cherry-pick/revert -m: add tests
  revert/cherry-pick: work on merge commits as well

Conflicts:

builtin-revert.c

17 years agoMerge branch 'ss/mailsplit'
Junio C Hamano [Sun, 4 Nov 2007 08:17:50 +0000 (01:17 -0700)]
Merge branch 'ss/mailsplit'

* ss/mailsplit:
  Make mailsplit and mailinfo strip whitespace from the start of the input

17 years agoMerge branch 'np/pack'
Junio C Hamano [Sun, 4 Nov 2007 08:11:17 +0000 (01:11 -0700)]
Merge branch 'np/pack'

* np/pack:
  pack-objects: get rid of an ugly cast
  make the pack index version configurable

Conflicts:

builtin-pack-objects.c

17 years agoMerge branch 'jn/gitweb'
Junio C Hamano [Sun, 4 Nov 2007 08:10:08 +0000 (01:10 -0700)]
Merge branch 'jn/gitweb'

* jn/gitweb:
  gitweb: Use config file for repository description and URLs
  gitweb: Read repo config using 'git config -z -l'
  gitweb: Add tests for overriding gitweb config with repo config
  gitweb: Use href(-replay=>1, action=>...) to generate alternate views
  gitweb: Use href(-replay=>1, page=>...) to generate pagination links
  gitweb: Easier adding/changing parameters to current URL
  gitweb: Remove CGI::Carp::set_programname() call from t9500 gitweb test
  gitweb: Add 'status_str' to parse_difftree_raw_line output
  gitweb: Always set 'from_file' and 'to_file' in parse_difftree_raw_line

17 years agoMerge branch 'np/fetch'
Junio C Hamano [Sun, 4 Nov 2007 08:06:48 +0000 (01:06 -0700)]
Merge branch 'np/fetch'

* np/fetch:
  git-fetch: more terse fetch output

17 years agoMerge branch 'maint'
Junio C Hamano [Sun, 4 Nov 2007 06:50:54 +0000 (23:50 -0700)]
Merge branch 'maint'

* maint:
  RelNotes-1.5.3.5: fix typo
  Delay pager setup in git blame
  git-cvsimport: really convert underscores in branch names to dots with -u

17 years agogit-reset: do not be confused if there is nothing to reset
Johannes Schindelin [Sat, 3 Nov 2007 13:12:17 +0000 (13:12 +0000)]
git-reset: do not be confused if there is nothing to reset

The purpose of the function update_index_from_diff() (which is the
callback function we give do_diff_cache()) is to update those index
entries which differ from the given commit.

Since do_diff_cache() plays games with the in-memory index, this function
discarded the cache and reread it.

Then, back in the function read_from_tree() we wrote the index.

Of course, this broke down when there were no changes and
update_index_from_diff() was not called, and therefore the mangled index
was not discarded.

The solution is to move the index writing into the function
update_index_from_diff().

Noticed by Björn Steinbrink.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-clone: honor "--" to end argument parsing
Heikki Orsila [Thu, 1 Nov 2007 14:21:39 +0000 (16:21 +0200)]
git-clone: honor "--" to end argument parsing

Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>
17 years agoRelNotes-1.5.3.5: fix typo
David D Kilzer [Sat, 3 Nov 2007 14:04:52 +0000 (07:04 -0700)]
RelNotes-1.5.3.5: fix typo

Signed-off-by: David D Kilzer <ddkilzer@kilzer.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-svn: sort the options in the --help message.
Benoit Sigoure [Sat, 3 Nov 2007 18:53:34 +0000 (19:53 +0100)]
git-svn: sort the options in the --help message.

"git svn <cmd> --help" gave options in the order they were found in a
Perl hash, which meant "randomly" to humans.

Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agobuiltin-fetch: Add "-q" as a synonym for "--quiet"
Steven Grimm [Sun, 4 Nov 2007 02:26:54 +0000 (19:26 -0700)]
builtin-fetch: Add "-q" as a synonym for "--quiet"

"-q" is the very first option described in the git-fetch manpage, and it
isn't supported.

Signed-off-by: Steven Grimm <koreth@midwinter.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoDelay pager setup in git blame
Mike Hommey [Sat, 3 Nov 2007 12:22:53 +0000 (13:22 +0100)]
Delay pager setup in git blame

This avoids to launch the pager when git blame fails for any reason.

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-cvsimport: really convert underscores in branch names to dots with -u
Gerrit Pape [Sat, 3 Nov 2007 11:55:02 +0000 (11:55 +0000)]
git-cvsimport: really convert underscores in branch names to dots with -u

The documentation states for the -u option that underscores in tag and
branch names are converted to dots, but this was actually implemented
for the tag names only.

Kurt Roeckx reported this through
 http://bugs.debian.org/446495

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoerrors: "strict subset" -> "ancestor"
J. Bruce Fields [Sat, 3 Nov 2007 02:39:44 +0000 (22:39 -0400)]
errors: "strict subset" -> "ancestor"

The term "ancestor" is a bit more intuitive (and more consistent with
the documentation) than the term "strict subset".

Also, remove superfluous "ref", capitalize, and add some carriage
returns, changing:

    error: remote 'refs/heads/master' is not a strict subset of local ref 'refs/heads/master'. maybe you are not up-to-date and need to pull first?
    error: failed to push to 'ssh://linux-nfs.org/~bfields/exports/git.git'

to:

    error: remote 'refs/heads/master' is not an ancestor of
    local 'refs/heads/master'.
    Maybe you are not up-to-date and need to pull first?
    error: failed to push to 'ssh://linux-nfs.org/~bfields/exports/git.git'

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-fetch: more terse fetch output
Nicolas Pitre [Sat, 3 Nov 2007 05:32:48 +0000 (01:32 -0400)]
git-fetch: more terse fetch output

This makes the fetch output much more terse and prettier on a 80 column
display, based on a consensus reached on the mailing list.  Here's an
example output:

Receiving objects: 100% (5439/5439), 1.60 MiB | 636 KiB/s, done.
Resolving deltas: 100% (4604/4604), done.
From git://git.kernel.org/pub/scm/git/git
 ! [rejected]        html -> origin/html  (non fast forward)
   136e631..f45e867  maint -> origin/maint  (fast forward)
   9850e2e..44dd7e0  man -> origin/man  (fast forward)
   3e4bb08..e3d6d56  master -> origin/master  (fast forward)
   fa3665c..536f64a  next -> origin/next  (fast forward)
 + 4f6d9d6...768326f pu -> origin/pu  (forced update)
 * [new branch]      todo -> origin/todo

Some portions of this patch have been extracted from earlier proposals
by Jeff King and Shawn Pearce.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogitweb: Use config file for repository description and URLs
Jakub Narebski [Fri, 2 Nov 2007 23:41:20 +0000 (00:41 +0100)]
gitweb: Use config file for repository description and URLs

Allow to use configuration variable gitweb.description for repository
description if there is no $GIT_DIR/description file, and multivalued
configuration variable gitweb.url for URLs of a project (to clone or
fetch from) if there is no $GIT_DIR/cloneurl file.

While repository description is shown in the projects list page, so it
is better to use file and not config variable for performance, it is I
think better to use gitweb.url for URLs (as it is shown only on
project summary page).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogitweb: Read repo config using 'git config -z -l'
Jakub Narebski [Fri, 2 Nov 2007 23:41:19 +0000 (00:41 +0100)]
gitweb: Read repo config using 'git config -z -l'

Change git_get_project_config to run git-config only once per
repository, without changing its signature (its calling convention).
This means for example that it returns 'true' or 'false' when called
with second argument '--bool', and not true or false value.

Instead of calling 'git config [<type>] --get gitweb.<key>' once for
each config variable, call 'git config -z -l' only once, parsing and
saving its output to %config variable.  This makes possible to add new
per repository configuration without paying cost of forking once per
variable checked.  We can now allow repository description and
repository URLs to be stored in config file without badly affecting
gitweb performance.

For now only configuration variables for 'gitweb' section are stored.

Multiple values for single configuration variable are stored as
anonymous array reference; configuration variable with no value is
stored as undef.

Converting configuration variable values to boolean or integer value
are done in Perl.  Results differ from git-config in the fact that no
conversion error is ever raised.  For boolean values no value, 'true'
(any case) and 'false' (any case) are considered true, numbers are
true if not zero; all other values (even invalid for bool) are
considered false.  For integer values value suffix of 'k', 'm', or 'g'
following decimal number will cause the value to be multiplied by
1024, 1048576, or 1073741824; other values are returned as-is, only
whitespace stripped.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogitweb: Add tests for overriding gitweb config with repo config
Jakub Narebski [Fri, 2 Nov 2007 23:41:18 +0000 (00:41 +0100)]
gitweb: Add tests for overriding gitweb config with repo config

Make blame view and snapshot support overridable by repository
config. Test tree view with both features disabled, and with both
features enabled.

Test with features enabled also tests multiple formats snapshot
support (in tree view).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agotest format-patch -s: make sure MIME content type is shown as needed
Junio C Hamano [Sat, 3 Nov 2007 00:55:31 +0000 (17:55 -0700)]
test format-patch -s: make sure MIME content type is shown as needed

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agocherry-pick/revert -m: add tests
Junio C Hamano [Sat, 3 Nov 2007 00:25:24 +0000 (17:25 -0700)]
cherry-pick/revert -m: add tests

This adds a new test to check cherry-pick/revert of a merge
commit.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'maint'
Junio C Hamano [Fri, 2 Nov 2007 23:56:42 +0000 (16:56 -0700)]
Merge branch 'maint'

* maint:
  Fixing path quoting in git-rebase
  Remove unecessary hard-coding of EDITOR=':' VISUAL=':' in some test suites.
  Documentation: quote commit messages consistently.
  Remove escaping of '|' in manpage option sections

17 years agoMerge branch 'ph/parseopt'
Junio C Hamano [Fri, 2 Nov 2007 23:42:23 +0000 (16:42 -0700)]
Merge branch 'ph/parseopt'

* ph/parseopt: (24 commits)
  gc: use parse_options
  Fixed a command line option type for builtin-fsck.c
  Make builtin-pack-refs.c use parse_options.
  Make builtin-name-rev.c use parse_options.
  Make builtin-count-objects.c use parse_options.
  Make builtin-fsck.c use parse_options.
  Update manpages to reflect new short and long option aliases
  Make builtin-for-each-ref.c use parse-opts.
  Make builtin-symbolic-ref.c use parse_options.
  Make builtin-update-ref.c use parse_options
  Make builtin-revert.c use parse_options.
  Make builtin-describe.c use parse_options
  Make builtin-branch.c use parse_options.
  Make builtin-mv.c use parse-options
  Make builtin-rm.c use parse_options.
  Port builtin-add.c to use the new option parser.
  parse-options: allow callbacks to take no arguments at all.
  parse-options: Allow abbreviated options when unambiguous
  Add shortcuts for very often used options.
  parse-options: make some arguments optional, add callbacks.
  ...

Conflicts:

Makefile
builtin-add.c

17 years agoMerge branch 'np/progress'
Junio C Hamano [Fri, 2 Nov 2007 23:27:37 +0000 (16:27 -0700)]
Merge branch 'np/progress'

* np/progress:
  Show total transferred as part of throughput progress
  make sure throughput display gets updated even if progress doesn't move
  return the prune-packed progress display to the inner loop
  add throughput display to git-push
  add some copyright notice to the progress display code
  add throughput display to index-pack
  add throughput to progress display
  relax usage of the progress API
  make struct progress an opaque type
  prune-packed: don't call display_progress() for every file
  Stop displaying "Pack pack-$ID created." during git-gc
  Teach prune-packed to use the standard progress meter
  Change 'Deltifying objects' to 'Compressing objects'
  fix for more minor memory leaks
  fix const issues with some functions
  pack-objects.c: fix some global variable abuse and memory leaks
  pack-objects: no delta possible with only one object in the list
  cope with multiple line breaks within sideband progress messages
  more compact progress display

17 years agoFixing path quoting in git-rebase
Jonathan del Strother [Wed, 17 Oct 2007 09:31:35 +0000 (10:31 +0100)]
Fixing path quoting in git-rebase

git-rebase used to fail when run from a path containing a space.

Signed-off-by: Jonathan del Strother <jon.delStrother@bestbefore.tv>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agoMerge branch 'br/gccfix'
Junio C Hamano [Fri, 2 Nov 2007 23:14:00 +0000 (16:14 -0700)]
Merge branch 'br/gccfix'

* br/gccfix:
  transport.c: squelch a gcc 4.0.1 complaint about an uninitialized variable

17 years agoMerge branch 'gp/maint-diffdoc'
Junio C Hamano [Fri, 2 Nov 2007 23:12:04 +0000 (16:12 -0700)]
Merge branch 'gp/maint-diffdoc'

* gp/maint-diffdoc:
  git-diff.txt: add section "output format" describing the diff formats

17 years agoMerge branch 'bk/maint-cvsexportcommit' into maint
Junio C Hamano [Fri, 2 Nov 2007 22:40:54 +0000 (15:40 -0700)]
Merge branch 'bk/maint-cvsexportcommit' into maint

* bk/maint-cvsexportcommit:
  cvsexportcommit: fix for commits that do not have parents

17 years agoRemove unecessary hard-coding of EDITOR=':' VISUAL=':' in some test suites.
Kristian Høgsberg [Fri, 2 Nov 2007 15:33:07 +0000 (11:33 -0400)]
Remove unecessary hard-coding of EDITOR=':' VISUAL=':' in some test suites.

They are already set and exoprted by sourcing ./test-lib.sh
in all test scripts.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoDocumentation: quote commit messages consistently.
Sergei Organov [Fri, 2 Nov 2007 17:12:57 +0000 (20:12 +0300)]
Documentation: quote commit messages consistently.

Documentation quotes commit messages 14 times with double-quotes, and 7
times with single-quotes. The patch turns everything to double-quotes.

A nice side effect is that documentation becomes more Windoze-friendly
as AFAIK single quotes won't work there.

Signed-off-by: Sergei Organov <osv@javad.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoRemove escaping of '|' in manpage option sections
Jonas Fonseca [Fri, 2 Nov 2007 09:10:11 +0000 (10:10 +0100)]
Remove escaping of '|' in manpage option sections

The escaped were ending up verbatim in the generated documentation.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agotransport.c: squelch a gcc 4.0.1 complaint about an uninitialized variable
Blake Ramsdell [Fri, 2 Nov 2007 02:38:22 +0000 (19:38 -0700)]
transport.c: squelch a gcc 4.0.1 complaint about an uninitialized variable

The variable is always set if it is going to be used; gcc just does
not notice it.

Signed-off-by: Blake Ramsdell <blaker@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-p4: Detect changes to executable bit and include them in p4 submit.
Chris Pettitt [Fri, 2 Nov 2007 03:43:14 +0000 (20:43 -0700)]
git-p4: Detect changes to executable bit and include them in p4 submit.

This changeset takes advantage of the new parseDiffTreeEntry(...) function to
detect changes to the execute bit in the git repository.  During submit, git-p4
now looks for changes to the executable bit and if it finds them it "reopens"
the file in perforce, which allows it to change the file type.

The logic for adding the executable bit in perforce is straightforward: the +x
modifier can be used. Removing the executable bit in perforce requires that the
entire filetype be redefined (there is no way to join remove the bit with a -x
modifier, for example). This changeset includes logic to remove the executable
bit from the full file type while preserving the base file type and other
modifiers.

Signed-off-by: Chris Pettitt <cpettitt@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-p4: Add a helper function to parse the full git diff-tree output.
Chris Pettitt [Fri, 2 Nov 2007 03:43:13 +0000 (20:43 -0700)]
git-p4: Add a helper function to parse the full git diff-tree output.

Signed-off-by: Chris Pettitt <cpettitt@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMake mailsplit and mailinfo strip whitespace from the start of the input
Simon Sasburg [Thu, 1 Nov 2007 22:57:45 +0000 (23:57 +0100)]
Make mailsplit and mailinfo strip whitespace from the start of the input

Signed-off-by: Simon Sasburg <Simon.Sasburg@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agopack-objects: get rid of an ugly cast
Nicolas Pitre [Fri, 2 Nov 2007 03:43:24 +0000 (23:43 -0400)]
pack-objects: get rid of an ugly cast

... when calling write_idx_file().

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agomake the pack index version configurable
Nicolas Pitre [Fri, 2 Nov 2007 03:26:04 +0000 (23:26 -0400)]
make the pack index version configurable

It is a good idea to use pack index version 2 all the time since it has
proper protection against propagation of certain pack corruptions when
repacking which is not possible with index version 1, as demonstrated
in test t5302.

Hence this config option.

The default is still pack index version 1.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogc: use parse_options
James Bowes [Fri, 2 Nov 2007 01:02:27 +0000 (21:02 -0400)]
gc: use parse_options

Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>