gitweb.git
Merge branch 'jl/maint-fetch-recursive-fix'Junio C Hamano Wed, 13 Jul 2011 21:31:37 +0000 (14:31 -0700)

Merge branch 'jl/maint-fetch-recursive-fix'

* jl/maint-fetch-recursive-fix:
fetch: Also fetch submodules in subdirectories in on-demand mode

Merge branch 'jc/maint-cygwin-trust-executable-bit... Junio C Hamano Wed, 13 Jul 2011 21:31:36 +0000 (14:31 -0700)

Merge branch 'jc/maint-cygwin-trust-executable-bit-default'

* jc/maint-cygwin-trust-executable-bit-default:
cygwin: trust executable bit by default

Merge branch 'aw/rebase-i-p'Junio C Hamano Wed, 13 Jul 2011 21:31:36 +0000 (14:31 -0700)

Merge branch 'aw/rebase-i-p'

* aw/rebase-i-p:
rebase -i -p: include non-first-parent commits in todo list

Merge branch 'rj/config-cygwin'Junio C Hamano Wed, 13 Jul 2011 21:31:36 +0000 (14:31 -0700)

Merge branch 'rj/config-cygwin'

* rj/config-cygwin:
config.c: Make git_config() work correctly when called recursively
t1301-*.sh: Fix the 'forced modes' test on cygwin
help.c: Fix detection of custom merge strategy on cygwin

Merge branch 'md/interix-update'Junio C Hamano Wed, 13 Jul 2011 21:31:36 +0000 (14:31 -0700)

Merge branch 'md/interix-update'

* md/interix-update:
Update the Interix default build configuration.

Merge branch 'ln/gitweb-mime-types-split-at-blank'Junio C Hamano Wed, 13 Jul 2011 21:31:36 +0000 (14:31 -0700)

Merge branch 'ln/gitweb-mime-types-split-at-blank'

* ln/gitweb-mime-types-split-at-blank:
gitweb: allow space as delimiter in mime.types

Merge branch 'jc/no-gitweb-test-without-cgi-etc'Junio C Hamano Wed, 13 Jul 2011 21:31:36 +0000 (14:31 -0700)

Merge branch 'jc/no-gitweb-test-without-cgi-etc'

* jc/no-gitweb-test-without-cgi-etc:
t/gitweb-lib.sh: skip gitweb tests when perl dependencies are not met

Merge branch 'fg/submodule-keep-updating'Junio C Hamano Wed, 13 Jul 2011 21:31:35 +0000 (14:31 -0700)

Merge branch 'fg/submodule-keep-updating'

* fg/submodule-keep-updating:
git-submodule.sh: clarify the "should we die now" logic
submodule update: continue when a checkout fails
git-sh-setup: add die_with_status

Conflicts:
git-submodule.sh

Merge branch 'jc/legacy-loose-object'Junio C Hamano Wed, 13 Jul 2011 21:31:34 +0000 (14:31 -0700)

Merge branch 'jc/legacy-loose-object'

* jc/legacy-loose-object:
sha1_file.c: "legacy" is really the current format

Merge branch 'an/shallow-doc'Junio C Hamano Wed, 13 Jul 2011 21:31:34 +0000 (14:31 -0700)

Merge branch 'an/shallow-doc'

* an/shallow-doc:
Document the underlying protocol used by shallow repositories and --depth commands.
Fix documentation of fetch-pack that implies that the client can disconnect after sending wants.

Documentation: clearly specify what refs are honored... Bert Wesarg Mon, 11 Jul 2011 09:14:18 +0000 (11:14 +0200)

Documentation: clearly specify what refs are honored by core.logAllRefUpdates

The documentation for logging updates in git-update-ref, doesn't make it
clear that only a specific subset of refs are honored by this variable.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

get_pwd_cwd(): Do not trust st_dev/st_ino blindlyJohannes Schindelin Sat, 9 Jul 2011 17:38:08 +0000 (19:38 +0200)

get_pwd_cwd(): Do not trust st_dev/st_ino blindly

10c4c88 (Allow add_path() to add non-existent directories to the path,
2008-07-21) introduced get_pwd_cwd() function in order to favor $PWD when
getenv("PWD") and getcwd() refer to the same directory but are different
strings (e.g. the former gives a nicer looking name via a symbolic link to
an uglier looking automounted path). The function tried to determine if
two directories are the same by running stat(2) on both and comparing
ino/dev fields.

Unfortunately, stat() does not fill any ino or dev fields in msysgit. But
there is a telltale: both ino and dev are 0 when they are not filled
correctly, so let's be extra cautious.

This happens to fix a bug in "get-receive-pack working_directory/" when
the GIT_DIR would not be set correctly due to absolute_path(".")
returning the wrong value.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack-objects: optimize "recency order"Junio C Hamano Thu, 30 Jun 2011 23:21:58 +0000 (16:21 -0700)

pack-objects: optimize "recency order"

This optimizes the "recency order" (see pack-heuristics.txt in
Documentation/technical/ directory) used to order objects within a
packfile in three ways:

- Commits at the tip of tags are written together, in the hope that
revision traversal done in incremental fetch (which starts by
putting them in a revision queue marked as UNINTERESTING) will see a
better locality of these objects;

- In the original recency order, trees and blobs are intermixed. Write
trees together before blobs, in the hope that this will improve
locality when running pathspec-limited revision traversal, i.e.
"git log paths...";

- When writing blob objects out, write the whole family of blobs that use
the same delta base object together, by starting from the root of the
delta chain, and writing its immediate children in a width-first
manner, in the hope that this will again improve locality when reading
blobs that belong to the same path, which are likely to be deltified
against each other.

I tried various workloads in the Linux kernel repositories (HEAD at
v3.0-rc6-71-g4dd1b49) packed with v1.7.6 and with this patch, counting how
large seeks are needed between adjacent accesses to objects in the pack,
and the result looks promising. The history has 2072052 objects, weighing
some 490MiB.

* Simple commit-only log.

$ git log >/dev/null

There are 254656 commits in total.

v1.7.6 with patch
Total number of access : 258,031 258,032
0.0% percentile : 12 12
10.0% percentile : 259 259
20.0% percentile : 294 294
30.0% percentile : 326 326
40.0% percentile : 363 363
50.0% percentile : 415 415
60.0% percentile : 513 513
70.0% percentile : 857 858
80.0% percentile : 10,434 10,441
90.0% percentile : 91,985 91,996
95.0% percentile : 260,852 260,885
99.0% percentile : 1,150,680 1,152,811
99.9% percentile : 3,148,435 3,148,435
Less than 2MiB seek: 99.70% 99.69%

95% of the pack accesses look at data that is no further than 260kB
from the previous location we accessed. The patch does not change the
order of commit objects very much, and the result is very similar.

* Pathspec-limited log.

$ git log drivers/net >/dev/null

The path is touched by 26551 commits and merges (among 254656 total).

v1.7.6 with patch
Total number of access : 559,511 558,663
0.0% percentile : 0 0
10.0% percentile : 182 167
20.0% percentile : 259 233
30.0% percentile : 357 304
40.0% percentile : 714 485
50.0% percentile : 5,046 3,976
60.0% percentile : 688,671 443,578
70.0% percentile : 319,574,732 110,370,100
80.0% percentile : 361,647,599 123,707,229
90.0% percentile : 393,195,669 128,947,636
95.0% percentile : 405,496,875 131,609,321
99.0% percentile : 412,942,470 133,078,115
99.5% percentile : 413,172,266 133,163,349
99.9% percentile : 413,354,356 133,240,445
Less than 2MiB seek: 61.71% 62.87%

With the current pack heuristics, more than 30% of accesses have to
seek further than 300MB; the updated pack heuristics ensures that less
than 0.1% of accesses have to seek further than 135MB. This is largely
due to the fact that the updated heuristics does not mix blobs and
trees together.

* Blame.

$ git blame drivers/net/ne.c >/dev/null

The path is touched by 34 commits and merges.

v1.7.6 with patch
Total number of access : 178,147 178,166
0.0% percentile : 0 0
10.0% percentile : 142 139
20.0% percentile : 222 194
30.0% percentile : 373 300
40.0% percentile : 1,168 837
50.0% percentile : 11,248 7,334
60.0% percentile : 305,121,284 106,850,130
70.0% percentile : 361,427,854 123,709,715
80.0% percentile : 388,127,343 128,171,047
90.0% percentile : 399,987,762 130,200,707
95.0% percentile : 408,230,673 132,174,308
99.0% percentile : 412,947,017 133,181,160
99.5% percentile : 413,312,798 133,220,425
99.9% percentile : 413,352,366 133,269,051
Less than 2MiB seek: 56.47% 56.83%

The result is very similar to the pathspec-limited log above, which
only looks at the tree objects.

* Packing recent history.

$ (git for-each-ref --format='^%(refname)' refs/tags; echo HEAD) |
git pack-objects --revs --stdout >/dev/null

This should pack data worth 71 commits.

v1.7.6 with patch
Total number of access : 11,511 11,514
0.0% percentile : 0 0
10.0% percentile : 48 47
20.0% percentile : 134 98
30.0% percentile : 332 178
40.0% percentile : 1,386 293
50.0% percentile : 8,030 478
60.0% percentile : 33,676 1,195
70.0% percentile : 147,268 26,216
80.0% percentile : 9,178,662 464,598
90.0% percentile : 67,922,665 965,782
95.0% percentile : 87,773,251 1,226,102
99.0% percentile : 98,011,763 1,932,377
99.5% percentile : 100,074,427 33,642,128
99.9% percentile : 105,336,398 275,772,650
Less than 2MiB seek: 77.09% 99.04%

The long-tail part of the result looks worse with the patch, but
the change helps majority of the access. 99.04% of the accesses
need less than 2MiB of seeking, compared to 77.09% with the current
packing heuristics.

* Index pack.

$ git index-pack -v .git/objects/pack/pack*.pack

v1.7.6 with patch
Total number of access : 2,791,228 2,788,802
0.0% percentile : 9 9
10.0% percentile : 140 89
20.0% percentile : 233 167
30.0% percentile : 322 235
40.0% percentile : 464 310
50.0% percentile : 862 423
60.0% percentile : 2,566 686
70.0% percentile : 25,827 1,498
80.0% percentile : 1,317,862 4,971
90.0% percentile : 11,926,385 119,398
95.0% percentile : 41,304,149 952,519
99.0% percentile : 227,613,070 6,709,650
99.5% percentile : 321,265,121 11,734,871
99.9% percentile : 382,919,785 33,155,191
Less than 2MiB seek: 81.73% 96.92%

As the index-pack command already walks objects in the delta chain
order, writing the blobs out in the delta chain order seems to
drastically improve the locality of access.

Note that a half-a-gigabyte packfile comfortably fits in the buffer cache,
and you would unlikely to see much performance difference on a modern and
reasonably beefy machine with enough memory and local disks. Benchmarking
with cold cache (or over NFS) would be interesting.

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

help_unknown_cmd: do not propose an "unknown" cmdMichael Schubert Fri, 8 Jul 2011 10:08:49 +0000 (12:08 +0200)

help_unknown_cmd: do not propose an "unknown" cmd

When executing an external shell script like `git foo` with a bad
shebang, e.g. "#!/usr/bin/not/existing", execvp returns 127 (ENOENT).

Since help_unknown_cmd proposes the use of all external commands similar
to the name of the "unknown" command, it suggests the just failed command
again. Stop it and give some advice to the user.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Michael Schubert <mschub@elegosoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

core: log offset pack data accesses happenedJunio C Hamano Thu, 7 Jul 2011 02:08:55 +0000 (19:08 -0700)

core: log offset pack data accesses happened

In a workload other than "git log" (without pathspec nor any option that
causes us to inspect trees and blobs), the recency pack order is said to
cause the access jump around quite a bit. Add a hook to allow us observe
how bad it is.

"git config core.logpackaccess /var/tmp/pal.txt" will give you the log
in the specified file.

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

Start 1.7.7 cycleJunio C Hamano Thu, 7 Jul 2011 00:00:46 +0000 (17:00 -0700)

Start 1.7.7 cycle

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

Merge branch 'maint'Junio C Hamano Wed, 6 Jul 2011 23:48:59 +0000 (16:48 -0700)

Merge branch 'maint'

* maint:
docs: document --textconv diff option

Merge commit 'v1.7.6' into jc/checkout-reflog-fixJunio C Hamano Wed, 6 Jul 2011 22:38:28 +0000 (15:38 -0700)

Merge commit 'v1.7.6' into jc/checkout-reflog-fix

* commit 'v1.7.6': (3211 commits)
Git 1.7.6
completion: replace core.abbrevguard to core.abbrev
Git 1.7.6-rc3
Documentation: git diff --check respects core.whitespace
gitweb: 'pickaxe' and 'grep' features requires 'search' to be enabled
t7810: avoid unportable use of "echo"
plug a few coverity-spotted leaks
builtin/gc.c: add missing newline in message
tests: link shell libraries into valgrind directory
t/Makefile: pass test opts to valgrind target properly
sh-i18n--envsubst.c: do not #include getopt.h
Fix typo: existant->existent
Git 1.7.6-rc2
gitweb: do not misparse nonnumeric content tag files that contain a digit
Git 1.7.6-rc1
fetch: do not leak a refspec
t3703: skip more tests using colons in file names on Windows
gitweb: Fix usability of $prevent_xss
gitweb: Move "Requirements" up in gitweb/INSTALL
gitweb: Describe CSSMIN and JSMIN in gitweb/INSTALL
...

Merge commit 'v1.7.0' into jc/checkout-reflog-fixJunio C Hamano Wed, 6 Jul 2011 22:38:18 +0000 (15:38 -0700)

Merge commit 'v1.7.0' into jc/checkout-reflog-fix

* commit 'v1.7.0': (4188 commits)
Git 1.7.0
Fix typo in 1.6.6.2 release notes
Re-fix check-ref-format documentation mark-up
archive documentation: attributes are taken from the tree by default
Documentation: minor fixes to RelNotes-1.7.0
bash: support 'git am's new '--continue' option
filter-branch: Fix error message for --prune-empty --commit-filter
am: switch --resolved to --continue
Update draft release notes to 1.7.0 one more time
Git 1.6.6.2
t8003: check exit code of command and error message separately
check-ref-format documentation: fix enumeration mark-up
Documentation: quote braces in {upstream} notation
t3902: Protect against OS X normalization
blame: prevent a segv when -L given start > EOF
git-push: document all the status flags used in the output
Fix parsing of imap.preformattedHTML and imap.sslverify
git-add documentation: Fix shell quoting example
Revert "pack-objects: fix pack generation when using pack_size_limit"
archive: simplify archive format guessing
...

Merge commit 'v1.6.0' into jc/checkout-reflog-fixJunio C Hamano Wed, 6 Jul 2011 22:37:42 +0000 (15:37 -0700)

Merge commit 'v1.6.0' into jc/checkout-reflog-fix

* commit 'v1.6.0': (2063 commits)
GIT 1.6.0
git-p4: chdir now properly sets PWD environment variable in msysGit
Improve error output of git-rebase
t9300: replace '!' with test_must_fail
Git.pm: Make File::Spec and File::Temp requirement lazy
Documentation: document the pager.* configuration setting
git-stash: improve synopsis in help and manual page
Makefile: building git in cygwin 1.7.0
git-am: ignore --binary option
bash-completion: Add non-command git help files to bash-completion
Fix t3700 on filesystems which do not support question marks in names
Utilise our new p4_read_pipe and p4_write_pipe wrappers
Add p4 read_pipe and write_pipe wrappers
bash completion: Add '--merge' long option for 'git log'
bash completion: Add completion for 'git mergetool'
git format-patch documentation: clarify what --cover-letter does
bash completion: 'git apply' should use 'fix' not 'strip'
t5304-prune: adjust file mtime based on system time rather than file mtime
test-parse-options: use appropriate cast in length_callback
Fix escaping of glob special characters in pathspecs
...

Conflicts:
builtin-checkout.c

checkout: do not write bogus reflog entry outJunio C Hamano Wed, 6 Jul 2011 22:14:43 +0000 (15:14 -0700)

checkout: do not write bogus reflog entry out

As resolve_ref() returns a static buffer that is local to the function,
the caller needs to be sure that it will not have any other calls to the
function before it uses the returned value, or store it away with a
strdup(). The code used old.path to record which branch it used to be on,
so that it can say between which branches the switch took place in the
reflog, but sometimes it failed to do so.

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

Documentation: use [verse] for SYNOPSIS sectionsMartin von Zweigbergk Sat, 2 Jul 2011 02:38:26 +0000 (22:38 -0400)

Documentation: use [verse] for SYNOPSIS sections

The SYNOPSIS sections of most commands that span several lines already
use [verse] to retain line breaks. Most commands that don't span
several lines seem not to use [verse]. In the HTML output, [verse]
does not only preserve line breaks, but also makes the section
indented, which causes a slight inconsistency between commands that
use [verse] and those that don't. Use [verse] in all SYNOPSIS sections
for consistency.

Also remove the blank lines from git-fetch.txt and git-rebase.txt to
align with the other man pages. In the case of git-rebase.txt, which
already uses [verse], the blank line makes the [verse] not apply to
the last line, so removing the blank line also makes the formatting
within the document more consistent.

While at it, add single quotes to 'git cvsimport' for consistency with
other commands.

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

docs: document --textconv diff optionJeff King Wed, 6 Jul 2011 15:13:30 +0000 (11:13 -0400)

docs: document --textconv diff option

This has been there since textconv existed, but was never
documented. There is some overlap with what's in
gitattributes(5), but it's important to warn in both places
that textconv diffs probably can't be applied.

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

mergetool: check return value from readJunio C Hamano Fri, 1 Jul 2011 23:11:16 +0000 (16:11 -0700)

mergetool: check return value from read

The process may not even have the standard input open in which case it
will get stuck in an infinite loop to prompt and read nothing.

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

git skew: a tool to find how big a clock skew exists... Jeff King Sat, 11 Jun 2011 19:04:11 +0000 (19:04 +0000)

git skew: a tool to find how big a clock skew exists in the history

> As you probably guessed from the specificity of the number, I wrote a
> short program to actually traverse and find the worst skew. It takes
> about 5 seconds to run (unsurprisingly, since it is doing the same full
> traversal that we end up doing in the above numbers). So we could
> "autoskew" by setting up the configuration on clone, and then
> periodically updating it as part of "git gc".

This patch doesn't implement auto-detection of skew, but is the program
I used to calculate, and would provide the basis for such
auto-detection. It would be interesting to see average skew numbers for
popular repositories. You can run it as "git skew --all".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Serve */*+xml 'blob_plain' as text/plain with... Jakub Narebski Thu, 30 Jun 2011 09:39:21 +0000 (11:39 +0200)

gitweb: Serve */*+xml 'blob_plain' as text/plain with $prevent_xss

Enhance usability of 'blob_plain' view protection against XSS attacks
(enabled by setting $prevent_xss to true) by serving contents inline
as safe 'text/plain' mimetype where possible, instead of serving with
"Content-Disposition: attachment" to make sure they don't run in
gitweb's security domain.

This patch broadens downgrading to 'text/plain' further, to any
*/*+xml mimetype. This includes:

application/xhtml+xml (*.xhtml, *.xht)
application/atom+xml (*.atom)
application/rss+xml (*.rss)
application/mathml+xm (*.mathml)
application/docbook+xml (*.docbook)
image/svg+xml (*.svg, *.svgz)

Probably most useful is serving XHTML files as text/plain in
'blob_plain' view, directly viewable.

Because file with 'image/svg+xml' mimetype can be compressed SVGZ
file, we have to check if */*+xml really is text file, via '-T $fd'.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Serve text/* 'blob_plain' as text/plain with... Jakub Narebski Thu, 30 Jun 2011 09:39:20 +0000 (11:39 +0200)

gitweb: Serve text/* 'blob_plain' as text/plain with $prevent_xss

One of mechanism enabled by setting $prevent_xss to true is 'blob_plain'
view protection. With XSS prevention on, blobs of all types except a
few known safe ones are served with "Content-Disposition: attachment" to
make sure they don't run in our security domain.

Instead of serving text/* type files, except text/plain (and including
text/html), as attachements, downgrade it to text/plain. This way HTML
pages in 'blob_plain' (raw) view would be displayed in browser, but
safely as a source, and not asked to be saved.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-submodule.sh: preserve stdin for the command spawne... Brandon Casey Thu, 30 Jun 2011 00:34:58 +0000 (19:34 -0500)

git-submodule.sh: preserve stdin for the command spawned by foreach

The user-supplied command spawned by 'submodule foreach' loses its
connection to the original standard input. Instead, it is connected to the
output of a pipe within the git-submodule script. The user-supplied
command supplied to 'submodule foreach' is spawned within a while loop
which is being piped into. Due to the way shells implement piping output
to a while loop, a subshell is created with its standard input attached to
the output of the pipe. This results in all of the commands executed
within the while loop to have their stdins modified in the same way,
including the user-supplied command.

This can cause a problem if the command requires reading from stdin or if
it changes its behavior based on whether stdin is a tty or not. For
example, this problem was noticed when trying to execute the following:

git submodule foreach git shortlog --since=two.weeks.ago

which printed a message about entering the first submodule and produced no
further output and exited with a status of zero. In this case, shortlog
detected that it was not connected to a tty, and since no revision was
supplied as an argument, it attempted to read the list of revisions from
standard input. Instead, it slurped up the list of submodules that was
being piped to the enclosing while loop and caused that loop to end early
without processing the remaining submodules.

Work around this behavior by saving the original standard input file
descriptor before the while loop, and restoring it when spawning the
user-supplied command.

This fixes the tests in t7407.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/t7407: demonstrate that the command called by 'submod... Brandon Casey Thu, 30 Jun 2011 00:34:57 +0000 (19:34 -0500)

t/t7407: demonstrate that the command called by 'submodule foreach' loses stdin

The user-supplied command spawned by 'submodule foreach' loses its
connection to the original standard input. Instead, it is connected to the
output of a pipe within the git-submodule script. This can cause a problem
if the command requires reading from stdin or if it changes its behavior
based on whether stdin is a tty or not (e.g. git shortlog). Demonstrate
this flaw.

Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jc/streaming-filter' into nextJunio C Hamano Thu, 30 Jun 2011 00:09:28 +0000 (17:09 -0700)

Merge branch 'jc/streaming-filter' into next

* jc/streaming-filter:
t0021: test application of both crlf and ident
t0021-conversion.sh: fix NoTerminatingSymbolAtEOF test
streaming: filter cascading
streaming filter: ident filter
Add LF-to-CRLF streaming conversion
stream filter: add "no more input" to the filters
Add streaming filter API
convert.h: move declarations for conversion from cache.h

Merge branch 'jn/gitweb-js-blame' into nextJunio C Hamano Thu, 30 Jun 2011 00:09:27 +0000 (17:09 -0700)

Merge branch 'jn/gitweb-js-blame' into next

* jn/gitweb-js-blame:
gitweb.js: use setTimeout rather than setInterval in blame_incremental.js
gitweb.js: No need for loop in blame_incremental's handleResponse()
gitweb.js: No need for inProgress in blame_incremental.js

Merge branch 'da/git-prefix-everywhere' into nextJunio C Hamano Thu, 30 Jun 2011 00:09:27 +0000 (17:09 -0700)

Merge branch 'da/git-prefix-everywhere' into next

* da/git-prefix-everywhere:
t/t7503-pre-commit-hook.sh: Add GIT_PREFIX tests
git-mergetool--lib: Make vimdiff retain the current directory
git: Remove handling for GIT_PREFIX
setup: Provide GIT_PREFIX to built-ins

Merge branch 'jc/streaming' into nextJunio C Hamano Thu, 30 Jun 2011 00:09:27 +0000 (17:09 -0700)

Merge branch 'jc/streaming' into next

* jc/streaming:
sha1_file: use the correct type (ssize_t, not size_t) for read-style function
streaming: read loose objects incrementally
sha1_file.c: expose helpers to read loose objects
streaming: read non-delta incrementally from a pack
streaming_write_entry(): support files with holes
convert: CRLF_INPUT is a no-op in the output codepath
streaming_write_entry(): use streaming API in write_entry()
streaming: a new API to read from the object store
write_entry(): separate two helper functions out
unpack_object_header(): make it public
sha1_object_info_extended(): hint about objects in delta-base cache
sha1_object_info_extended(): expose a bit more info
packed_object_info_detail(): do not return a string

Merge branch 'ab/i18n-scripts' into nextJunio C Hamano Thu, 30 Jun 2011 00:09:27 +0000 (17:09 -0700)

Merge branch 'ab/i18n-scripts' into next

* ab/i18n-scripts: (48 commits)
i18n: git-bisect bisect_next_check "You need to" message
i18n: git-bisect [Y/n] messages
i18n: git-bisect bisect_replay + $1 messages
i18n: git-bisect bisect_reset + $1 messages
i18n: git-bisect bisect_run + $@ messages
i18n: git-bisect die + eval_gettext messages
i18n: git-bisect die + gettext messages
i18n: git-bisect echo + eval_gettext message
i18n: git-bisect echo + gettext messages
i18n: git-bisect gettext + echo message
i18n: git-bisect add git-sh-i18n
i18n: git-stash drop_stash say/die messages
i18n: git-stash "unknown option" message
i18n: git-stash die + eval_gettext $1 messages
i18n: git-stash die + eval_gettext $* messages
i18n: git-stash die + eval_gettext messages
i18n: git-stash die + gettext messages
i18n: git-stash say + gettext messages
i18n: git-stash echo + gettext message
i18n: git-stash add git-sh-i18n
...

Merge branch 'ef/maint-win-verify-path'Junio C Hamano Thu, 30 Jun 2011 00:09:17 +0000 (17:09 -0700)

Merge branch 'ef/maint-win-verify-path'

* ef/maint-win-verify-path:
verify_dotfile(): do not assume '/' is the path seperator
verify_path(): simplify check at the directory boundary
verify_path: consider dos drive prefix
real_path: do not assume '/' is the path seperator
A Windows path starting with a backslash is absolute

Merge branch 'js/i18n-windows'Junio C Hamano Thu, 30 Jun 2011 00:03:13 +0000 (17:03 -0700)

Merge branch 'js/i18n-windows'

* js/i18n-windows:
Windows: teach getenv to do a case-sensitive search
mingw.c: move definition of mingw_getenv down
sh-i18n--envsubst: do not crash when no arguments are given

Merge branch 'rs/grep-color'Junio C Hamano Thu, 30 Jun 2011 00:03:13 +0000 (17:03 -0700)

Merge branch 'rs/grep-color'

* rs/grep-color:
grep: add --heading
grep: add --break
grep: fix coloring of hunk marks between files

Merge branch 'jc/maint-1.7.3-checkout-describe'Junio C Hamano Thu, 30 Jun 2011 00:03:12 +0000 (17:03 -0700)

Merge branch 'jc/maint-1.7.3-checkout-describe'

* jc/maint-1.7.3-checkout-describe:
checkout -b <name>: correctly detect existing branch

Merge branch 'db/http-cookies'Junio C Hamano Thu, 30 Jun 2011 00:03:12 +0000 (17:03 -0700)

Merge branch 'db/http-cookies'

* db/http-cookies:
http: pass http.cookiefile using CURLOPT_COOKIEFILE

Merge branch 'jk/maint-1.7.2-status-ignored'Junio C Hamano Thu, 30 Jun 2011 00:03:12 +0000 (17:03 -0700)

Merge branch 'jk/maint-1.7.2-status-ignored'

* jk/maint-1.7.2-status-ignored:
git status --ignored: tests and docs
status: fix bug with missing --ignore files

Conflicts:
Documentation/git-status.txt
t/t7508-status.sh

Merge branch 'jc/diff-index-quick-exit-early'Junio C Hamano Thu, 30 Jun 2011 00:03:11 +0000 (17:03 -0700)

Merge branch 'jc/diff-index-quick-exit-early'

* jc/diff-index-quick-exit-early:
diff-index --quiet: learn the "stop feeding the backend early" logic

Conflicts:
unpack-trees.h

Merge branch 'mg/diff-stat-count'Junio C Hamano Thu, 30 Jun 2011 00:03:10 +0000 (17:03 -0700)

Merge branch 'mg/diff-stat-count'

* mg/diff-stat-count:
diff --stat-count: finishing touches
diff-options.txt: describe --stat-{width,name-width,count}
diff: introduce --stat-lines to limit the stat lines
diff.c: omit hidden entries from namelen calculation with --stat

Merge branch 'jc/advice-about-to-lose-commit'Junio C Hamano Thu, 30 Jun 2011 00:03:10 +0000 (17:03 -0700)

Merge branch 'jc/advice-about-to-lose-commit'

* jc/advice-about-to-lose-commit:
checkout: make advice when reattaching the HEAD less loud

Conflicts:
builtin/checkout.c

Merge branch 'jk/combine-diff-binary-etc'Junio C Hamano Thu, 30 Jun 2011 00:03:10 +0000 (17:03 -0700)

Merge branch 'jk/combine-diff-binary-etc'

* jk/combine-diff-binary-etc:
combine-diff: respect textconv attributes
refactor get_textconv to not require diff_filespec
combine-diff: handle binary files as binary
combine-diff: calculate mode_differs earlier
combine-diff: split header printing into its own function

Merge branch 'instaweb' of git://bogomips.org/git-svnJunio C Hamano Wed, 29 Jun 2011 23:43:23 +0000 (16:43 -0700)

Merge branch 'instaweb' of git://bogomips.org/git-svn

* 'instaweb' of git://bogomips.org/git-svn:
git-instaweb: Check that correct config file exists for (re)start
git-instaweb: Move all actions at the end of script
git-instaweb: Use $conf, not $fqgitdir/gitweb/httpd.conf
git-instaweb: Extract configuring web server into configure_httpd

Merge git://bogomips.org/git-svn into maintJunio C Hamano Wed, 29 Jun 2011 23:42:41 +0000 (16:42 -0700)

Merge git://bogomips.org/git-svn into maint

* git://bogomips.org/git-svn:
git-svn: Correctly handle root commits in mergeinfo ranges
git-svn: Disambiguate rev-list arguments to improve error message
git-svn: Demonstrate a bug with root commits in mergeinfo ranges

Merge branch 'maint-1.7.5' into maintJunio C Hamano Wed, 29 Jun 2011 23:41:55 +0000 (16:41 -0700)

Merge branch 'maint-1.7.5' into maint

* maint-1.7.5:
test: skip clean-up when running under --immediate mode
"branch -d" can remove more than one branches

test: skip clean-up when running under --immediate... Junio C Hamano Mon, 27 Jun 2011 18:02:22 +0000 (11:02 -0700)

test: skip clean-up when running under --immediate mode

Some tests try to be too careful about cleaning themselves up and
do

test_expect_success description '
set-up some test refs and/or configuration &&
test_when_finished "revert the above changes" &&
the real test
'

Which is nice to make sure that a potential failure would not have
unexpected interaction with the next test. This however interferes when
"the real test" fails and we want to see what is going on, by running the
test with --immediate mode and descending into its trash directory after
the test stops. The precondition to run the real test and cause it to fail
is all gone after the clean-up procedure defined by test_when_finished is
done.

Update test_run_ which is the workhorse of running a test script
called from test_expect_success and test_expect_failure, so that we do not
run clean-up script defined with test_when_finished when a test that is
expected to succeed fails under the --immediate mode.

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

"branch -d" can remove more than one branchesJunio C Hamano Mon, 27 Jun 2011 22:04:32 +0000 (15:04 -0700)

"branch -d" can remove more than one branches

Since 03feddd (git-check-ref-format: reject funny ref names, 2005-10-13),
"git branch -d" can take more than one branch names to remove.

The documentation was correct, but the usage string was not.

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

rebase: do not print lots of usage hints after an obvio... Johannes Sixt Tue, 28 Jun 2011 12:46:14 +0000 (14:46 +0200)

rebase: do not print lots of usage hints after an obvious error message

When a non-existent branch was specified to be rebased, the complete
usage information is printed after the error message that carries the
relevant piece of information:

$ git rebase master topci
fatal: no such branch: topci
usage: git rebase [-i] [options] [--onto <newbase>] [<upstream>] [<branch>]
or: git rebase [-i] [options] --onto <newbase> --root [<branch>]
or: git-rebase [-i] --continue | --abort | --skip

Available options are
[30 lines of usage stripped]

The error message was introduced recently by 4ac5356c (rebase: give a
better error message for bogus branch, 2011-01-27), and the result was
acceptable because the usage text was just two lines. But 45e2acf3
(rebase: define options in OPTIONS_SPEC, 2011-02-28) made things worse
because the usage text is now 35 lines.

Just drop the usage information because it does not add value to the
error message.

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

Documentation/i18n: quote double-dash for AsciiDocJonathan Nieder Wed, 29 Jun 2011 05:36:48 +0000 (00:36 -0500)

Documentation/i18n: quote double-dash for AsciiDoc

As explained in v1.7.3-rc0~13^2 (Work around em-dash handling in newer
AsciiDoc, 2010-08-23), if double dashes in names of commands are not
escaped, AsciiDoc renders them as em dashes.

While fixing that, spell the command name as "git sh-i18n--envsubst"
(2 words) instead of emphasizing the name of the binary (one
hyphenated name) and format it in italics.

The double-dash in the title should be escaped, too, to avoid spurious
em dashes in the header:

.TH "GIT\-SH\-I18N\(emENVSUB" "1" "06/26/2011" "Git 1\&.7\&.6" "Git Manual"

AsciiDoc 8.6.4 with DocBook XSL 1.76.0-RC1 copes fine and writes
"GIT\-SH\-I18N\-\-ENVSUB" even without this change, which is why it
was missed before.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jn/maint-doc-dashdash' into jn/doc-dashdashJunio C Hamano Wed, 29 Jun 2011 16:25:51 +0000 (09:25 -0700)

Merge branch 'jn/maint-doc-dashdash' into jn/doc-dashdash

* jn/maint-doc-dashdash:
Documentation: quote double-dash for AsciiDoc

Documentation: quote double-dash for AsciiDocJonathan Nieder Wed, 29 Jun 2011 05:35:10 +0000 (00:35 -0500)

Documentation: quote double-dash for AsciiDoc

AsciiDoc versions since 5.0.6 treat a double-dash surrounded by spaces
(outside of verbatim environments) as a request to insert an em dash.
Such versions also treat the three-character sequence "\--", when not
followed by another dash, as a request to insert two literal minus
signs. Thus from time to time there have been patches to add
backslashes to AsciiDoc markup to escape double-dashes that are meant
to be represent '--' characters used literally on the command line;
see v1.4.0-rc1~174, Fix up docs where "--" isn't displayed correctly,
2006-05-05, for example.

AsciiDoc 6.0.3 (2005-04-20) made life harder by also treating
double-dashes without surrounding whitespace as markup for an em dash,
though only when formatting for backends other than the manpages
(e.g., HTML). Many pages needed to be changed to use a backslash
before the "--" in names of command-line flags like "--add" (see
v0.99.6~37, Update tutorial, 2005-08-30).

AsciiDoc 8.3.0 (2008-11-29) refined the em-dash rule to avoid that
requirement. Double-dashes without surrounding spaces are not
rendered as em dashes any more unless bordered on both sides by
alphanumeric characters. The unescaped markup for option names (e.g.,
"--add") works fine, and many instances of this style have leaked into
Documentation/; git's HTML documentation contains many spurious em
dashes when formatted by an older toolchain. (This patch will not
change that.)

The upshot: "--" as an isolated word and in phrases like "git
web--browse" must be escaped if it is not to be rendered as an em dash
by current asciidoc. Use "\--" to avoid such misformatting in
sentences in which "--" represents a literal double-minus command line
argument that separates options and revs from pathspecs, and use
"{litdd}" in cases where the double-dash is embedded in the command
name. The latter is just for consistency with v1.7.3-rc0~13^2 (Work
around em-dash handling in newer AsciiDoc, 2010-08-23).

List of lines to fix found by grepping manpages for "(em".

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Improved-by: Junio C Hamano <gitster@pobox.com>
Improved-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-svn: Correctly handle root commits in mergeinfo... Michael Haggerty Sat, 18 Jun 2011 06:48:00 +0000 (08:48 +0200)

git-svn: Correctly handle root commits in mergeinfo ranges

If the bottom of a mergeinfo range is a commit that maps to a git root
commit, then it doesn't have a parent. In such a case, use git commit
range "$top_commit" rather than "$bottom_commit^..$top_commit".

[ew: line-wrap at 80 columns]

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>

git-svn: Disambiguate rev-list arguments to improve... Michael Haggerty Sat, 18 Jun 2011 06:47:59 +0000 (08:47 +0200)

git-svn: Disambiguate rev-list arguments to improve error message

Add "--" in the "git rev-list" command line so that if there is a bug
and the revisions cannot be found, the error message is a bit less
cryptic.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>

git-svn: Demonstrate a bug with root commits in mergein... Michael Haggerty Sat, 18 Jun 2011 06:47:58 +0000 (08:47 +0200)

git-svn: Demonstrate a bug with root commits in mergeinfo ranges

If a svn:mergeinfo range starts at a commit that was converted as a
git root commit (e.g., r1 or a branch that was created out of thin
air), then there is an error when git-svn tries to run

git rev-list "$bottom_commit^..$top_commit"

because $bottom_commit (the git commit corresponding to r1) has no
parent.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>

git-instaweb: Check that correct config file exists... Jakub Narebski Thu, 23 Jun 2011 21:01:03 +0000 (23:01 +0200)

git-instaweb: Check that correct config file exists for (re)start

Currently start/restart does not generate any configuration files for
spawning a new instance. This means that

$ git instaweb --http=<server> --start

might pick up stale 'httpd.conf' file for a different web server
(e.g. for default lighttpd when requesting apache2).

This commit changes that, and makes git-instaweb generate web server
config file and/or gitweb config file if don't exists.

This required naming config files after the name of web server
(alternate solution would be to somehow mark for which web server was
config file generated).

Note that web servers that embed configuration in server script file,
namely webrick and plackup, and which delete "$conf" in their *_conf
function, would have their config (server script) always regenerated.

Note: this commit introduces a bit of code repetition (but only a few
lines).

Reported-by: Gurjeet Singh <singh.gurjeet@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>

git-instaweb: Move all actions at the end of scriptJakub Narebski Thu, 23 Jun 2011 20:59:26 +0000 (22:59 +0200)

git-instaweb: Move all actions at the end of script

As a nice side-effect now the order of parameters does not matter:

$ git instaweb --httpd=apache2 --start

is now (after this patch) the same as

$ git instaweb --start --httpd=apache2

Before this commit --start, --stop, --restart (and their subcommand
versions start, stop, restart) exited immediately.

This is preparatory work for making start/restart check that correct
configuration is set up; this change was required to have access in
start_httpd to requested web browser etc.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>

git-instaweb: Use $conf, not $fqgitdir/gitweb/httpd... Jakub Narebski Thu, 23 Jun 2011 19:56:37 +0000 (21:56 +0200)

git-instaweb: Use $conf, not $fqgitdir/gitweb/httpd.conf

Don't repeat yourself: use "$conf" instead of its [current] contents,
namely "$fqgitdir/gitweb/httpd.conf".

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>

git-instaweb: Extract configuring web server into confi... Jakub Narebski Thu, 23 Jun 2011 19:55:00 +0000 (21:55 +0200)

git-instaweb: Extract configuring web server into configure_httpd

This is preparatory work for making start/restart check that
git-instaweb set up correct configuration, and generate it if it is
missing.

Pure refactoring, no functional changes.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>

submodule add: always initialize .git/config entryJens Lehmann Sat, 25 Jun 2011 23:26:02 +0000 (01:26 +0200)

submodule add: always initialize .git/config entry

When "git submodule add $path" is run to add a subdirectory $path to the
superproject, and $path is already the top of the working tree of the
submodule repository, the command created submodule.$path.url entry in the
configuration file in the superproject. However, when adding a repository
$URL that is outside the respository of the superproject to $path that
does not exist (yet) with "git submodule add $URL $path", the command
forgot to set it up.

The user is expressing the interest in the submodule and wants to keep a
checkout, the "submodule add" command should consistently set up the
submodule.$path.url entry in either case.

As a result "git submodule init" can't simply skip the initialization of
those submodules for which it finds an url entry in the git./config
anymore. That lead to problems when adding a submodule (which now sets the
url), add the "update" setting to .gitmodules and expect init to copy that
into .git/config like it is done in t7406. So change init to only then
copy the "url" and "update" entries when they don't exist yet in the
.git/config and do nothing otherwise.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule sync: do not auto-vivify uninteresting submoduleJunio C Hamano Sat, 25 Jun 2011 20:41:25 +0000 (22:41 +0200)

submodule sync: do not auto-vivify uninteresting submodule

Earlier 33f072f (submodule sync: Update "submodule.<name>.url" for empty
directories, 2010-10-08) attempted to fix a bug where "git submodule sync"
command does not update the URL if the current superproject does not have
a checkout of the submodule.

However, it did so by unconditionally registering submodule.$name.url to
every submodule in the project, even the ones that the user has never
showed interest in at all by running 'git submodule init' command. This
caused subsequent 'git submodule update' to start cloning/updating submodules
that are not interesting to the user at all.

Update the code so that the URL is updated from the .gitmodules file only
for submodules that already have submodule.$name.url entries, i.e. the
ones the user has showed interested in having a checkout.

Acked-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

stash: Add --include-untracked option to stash and... David Caldwell Sat, 25 Jun 2011 00:56:06 +0000 (17:56 -0700)

stash: Add --include-untracked option to stash and remove all untracked files

The --include-untracked option acts like the normal "git stash save" but
also adds all untracked files in the working directory to the stash and then
calls "git clean --force --quiet" to restore the working directory to a
pristine state.

This is useful for projects that need to run release scripts. With this
option, the release scripts can be from the main working directory so one
does not have to maintain a "clean" directory in parallel just for
releasing. Basically the work-flow becomes:

$ git tag release-1.0
$ git stash --include-untracked
$ make release
$ git clean -f
$ git stash pop

"git stash" alone is not enough in this case--it leaves untracked files
lying around that might mess up a release process that expects everything to
be very clean or might let a release succeed that should actually fail (due
to a new source file being created that hasn't been committed yet).

Signed-off-by: David Caldwell <david@porkrind.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 1.7.6 v1.7.6Junio C Hamano Sun, 26 Jun 2011 19:41:16 +0000 (12:41 -0700)

Git 1.7.6

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

Merge branch 'maint'Junio C Hamano Sun, 26 Jun 2011 19:09:11 +0000 (12:09 -0700)

Merge branch 'maint'

* maint:
completion: replace core.abbrevguard to core.abbrev

Merge branch 'maint-1.7.4' into maintJunio C Hamano Fri, 24 Jun 2011 16:40:02 +0000 (09:40 -0700)

Merge branch 'maint-1.7.4' into maint

* maint-1.7.4:
completion: replace core.abbrevguard to core.abbrev

completion: replace core.abbrevguard to core.abbrevNamhyung Kim Fri, 24 Jun 2011 06:17:42 +0000 (15:17 +0900)

completion: replace core.abbrevguard to core.abbrev

The core.abbrevguard config variable had removed and
now core.abbrev has been used instead. Teach it.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

glossary: clarify description of HEADJunio C Hamano Thu, 23 Jun 2011 16:48:49 +0000 (09:48 -0700)

glossary: clarify description of HEAD

HEAD on a branch does reference a commit via the branch ref it refers to.
The main difference of a detached HEAD is that it _directly_ refers to
a commit. Clarify this.

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

glossary: update description of head and refJunio C Hamano Thu, 23 Jun 2011 16:47:28 +0000 (09:47 -0700)

glossary: update description of head and ref

Reword them to avoid sounding as if loose refs are the only ones in the world.

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

glossary: update description of "tag"Junio C Hamano Thu, 23 Jun 2011 16:38:48 +0000 (09:38 -0700)

glossary: update description of "tag"

It is an unimportant implementation detail that ref namespaces are
implemented as subdirectories of $GIT_DIR/refs. What is more important
is that tags are in refs/tags hierarchy in the ref namespace.

Also note that a tag can point at an object of arbitrary type, not limited
to commit.

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

git.txt: de-emphasize the implementation detail of... Junio C Hamano Thu, 23 Jun 2011 16:35:10 +0000 (09:35 -0700)

git.txt: de-emphasize the implementation detail of a ref

It is an unimportant implementation detail that branches and tags are
stored somewhere under $GIT_DIR/refs directory, or the name of the commit
that will become the parent of the next commit is stored in $GIT_DIR/HEAD.

What is more important is that branches live in refs/heads and tags live
in refs/tags hierarchy in the ref namespace, and HEAD means the tip of the
current branch.

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

check-ref-format doc: de-emphasize the implementation... Junio C Hamano Thu, 23 Jun 2011 16:31:19 +0000 (09:31 -0700)

check-ref-format doc: de-emphasize the implementation detail of a ref

It is an unimportant implementation detail that branches and tags are
stored somewhere under $GIT_DIR/refs directory. What is more important
is that branches live in refs/heads and tags live in refs/tags hierarchy
in the ref namespace.

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

git-remote.txt: avoid sounding as if loose refs are... Junio C Hamano Thu, 23 Jun 2011 15:33:05 +0000 (08:33 -0700)

git-remote.txt: avoid sounding as if loose refs are the only ones in the world

It was correct to say "The file $GIT_DIR/refs/heads/master stores the
commit object name at the tip of the master branch" in the older days,
but not anymore, as refs can be packed into $GIT_DIR/packed-refs file.

Update the document to talk in terms of a more abstract concept "ref" and
"symbolic ref" where we are not describing the underlying implementation
detail.

This on purpose leaves two instances of $GIT_DIR/ in the git-remote
documentation; they do talk about $GIT_DIR/remotes/ and $GIT_DIR/branches/
file hierarchy that used to be the place to store configuration around
remotes before the configuration mechanism took them over.

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

git-remote.txt: fix wrong remote refspecNamhyung Kim Thu, 23 Jun 2011 08:12:04 +0000 (17:12 +0900)

git-remote.txt: fix wrong remote refspec

$GIT_DIR/remotes/<name>/<branch> should be
$GIT_DIR/refs/remotes/<name>/<branch>.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 1.7.6-rc3 v1.7.6-rc3Junio C Hamano Wed, 22 Jun 2011 23:13:16 +0000 (16:13 -0700)

Git 1.7.6-rc3

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

gitweb: Refactor git_header_htmlJakub Narebski Wed, 22 Jun 2011 11:50:46 +0000 (13:50 +0200)

gitweb: Refactor git_header_html

Extract the following parts into separate subroutines:

* finding correct MIME content type for HTML pages (text/html or
application/xhtml+xml?) into get_content_type_html()
* printing <link ...> elements in HTML head into print_header_links()
* printing navigation "breadcrumbs" for given action into
print_nav_breadcrumbs()
* printing search form into print_search_form()

This reduces git_header_html to two pages long (53 lines), making gitweb
code easier to read.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Wed, 22 Jun 2011 21:01:18 +0000 (14:01 -0700)

Merge branch 'maint'

* maint:
Documentation: git diff --check respects core.whitespace

Makefile: Track changes to LDFLAGS and relink when... Fredrik Kuivinen Wed, 22 Jun 2011 10:50:56 +0000 (12:50 +0200)

Makefile: Track changes to LDFLAGS and relink when necessary

Some profiling tools (e.g., google-perftools and mutrace) work by
linking in a new library into the executables. When using these tools
it is convenient to only relink instead of doing a full make clean;
make cycle.

This change complements the auto-detection of changes to CFLAGS that
we already have. Tracking of more variables that affect the build can
be added when the need arise.

Signed-off-by: Fredrik Kuivinen <frekui@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Make git_search_* subroutines render whole... Jakub Narebski Wed, 22 Jun 2011 15:28:55 +0000 (17:28 +0200)

gitweb: Make git_search_* subroutines render whole pages

Move git_header_html() and git_footer_html() invocation from git_search()
to individual git_search_* subroutines.

While at it, reorganize search-related code a bit, moving invoking of git
commands before any output is generated.

This has the following advantages:

* gitweb now shows an error page if there was unknown search type
(evaluate_and_validate_params checks only that it looks sanely);
remember that we shouldn't call die_error after any output.

* git_search_message is now safe agains die_error in parse_commits
(though this is very unlikely).

* gitweb now can check errors while invoking git commands and show
error page (again, quite unlikely).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Clean up code in git_search_* subroutinesJakub Narebski Wed, 22 Jun 2011 15:28:54 +0000 (17:28 +0200)

gitweb: Clean up code in git_search_* subroutines

Replace sequence of

$foo .= "bar";
$foo .= "baz";

with

$foo .= "bar" .
"baz";

Use href(-replay=>1, -page=>undef) for first page of a multipl-page view.

Wrap some lines to reduce their length. Some lines still have more than 80
characters, but lines are shorter now.

No functional changes intended.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Split body of git_search into subroutinesJakub Narebski Wed, 22 Jun 2011 15:28:53 +0000 (17:28 +0200)

gitweb: Split body of git_search into subroutines

Create separate subroutines for handling each of aspects of searching
the repository:

* git_search_message ('commit', 'author', 'committer')
* git_search_changes ('pickaxe')
* git_search_content_of_files ('grep')

Almost pure code movement (and unindent), which you can check e.g. via

$ git blame -w --date=short -C -C HEAD^..HEAD -- gitweb/gitweb.perl |
grep -C 3 -e '^[^^]' | less -S

No functional changes intended.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Check permissions first in git_searchJakub Narebski Wed, 22 Jun 2011 15:28:52 +0000 (17:28 +0200)

gitweb: Check permissions first in git_search

Check first if relevant features: 'search', 'pickaxe', 'grep', as
appropriate, are enabled before doing anything else in git_search.
This should make git_search code more clear.

While at it, expand a bit error message (e.g. 'Pickaxe' ->
'Pickaxe search').

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: git diff --check respects core.whitespaceChristof Krüger Wed, 22 Jun 2011 15:33:02 +0000 (17:33 +0200)

Documentation: git diff --check respects core.whitespace

Fix documentation on "git diff --check" by adopting the description from
"git apply --whitespace".

Signed-off-by: Christof Krüger <git@christof-krueger.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

clone: accept config options on the command lineJeff King Thu, 9 Jun 2011 20:56:19 +0000 (16:56 -0400)

clone: accept config options on the command line

Clone does all of init, "remote add", fetch, and checkout
without giving the user a chance to intervene and set any
configuration. This patch allows you to set config options
in the newly created repository after the clone, but before
we do any other operations.

In many cases, this is a minor convenience over something
like:

git clone git://...
git config core.whatever true

But in some cases, it can bring extra efficiency by changing
how the fetch or checkout work. For example, setting
line-ending config before the checkout avoids having to
re-checkout all of the contents with the correct line
endings.

It also provides a mechanism for passing information to remote
helpers during a clone; the helpers may read the git config
to influence how they operate.

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

config: make git_config_parse_parameter a public functionJeff King Thu, 9 Jun 2011 15:56:42 +0000 (11:56 -0400)

config: make git_config_parse_parameter a public function

We use this internally to parse "git -c core.foo=bar", but
the general format of "key=value" is useful for other
places.

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

remote: use new OPT_STRING_LISTJeff King Thu, 9 Jun 2011 15:55:59 +0000 (11:55 -0400)

remote: use new OPT_STRING_LIST

This saves us having our own callback function.

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

parse-options: add OPT_STRING_LIST helperJeff King Thu, 9 Jun 2011 15:55:23 +0000 (11:55 -0400)

parse-options: add OPT_STRING_LIST helper

This just adds repeated invocations of an option to a list
of strings. Using the "--no-<var>" form will reset the list
to empty.

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

config: use strbuf_split_str instead of a temporary... Jeff King Thu, 9 Jun 2011 15:55:09 +0000 (11:55 -0400)

config: use strbuf_split_str instead of a temporary strbuf

This saves an allocation and copy, and also fixes a minor
memory leak.

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

strbuf: allow strbuf_split to work on non-strbufsJeff King Thu, 9 Jun 2011 15:54:58 +0000 (11:54 -0400)

strbuf: allow strbuf_split to work on non-strbufs

The strbuf_split function takes a strbuf as input, and
outputs a list of strbufs. However, there is no reason that
the input has to be a strbuf, and not an arbitrary buffer.

This patch adds strbuf_split_buf for a length-delimited
buffer, and strbuf_split_str for NUL-terminated strings.

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

config: avoid segfault when parsing command-line configJeff King Thu, 9 Jun 2011 15:52:43 +0000 (11:52 -0400)

config: avoid segfault when parsing command-line config

We already check for an empty key on the left side of an
equals, but we would segfault if there was no content at
all.

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

config: die on error in command-line configJeff King Thu, 9 Jun 2011 15:52:32 +0000 (11:52 -0400)

config: die on error in command-line config

The error handling for git_config is somewhat confusing. We
collect errors from running git_config_from_file on the
various config files and carefully pass them back up. But
the two odd things are:

1. We actually die on most errors in git_config_from_file.
In fact, the only error we actually pass back up is if
fopen() fails on the file.

2. Most callers of git_config do not check the error
return at all, but will continue if git_config reports
an error.

When the code for "git -c core.foo=bar" was added, it
dutifully passed errors up the call stack, only for them to
be eventually ignored. This makes it inconsistent with the
file-parsing code, which will die when it sees malformed
config. And it's somewhat unsafe, because it means an error
in parsing a typo like:

git -c clean.requireforce=ture clean

will continue the command, ignoring the config the user
tried to give.

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

fix "git -c" parsing of values with equals signsJeff King Thu, 9 Jun 2011 15:51:36 +0000 (11:51 -0400)

fix "git -c" parsing of values with equals signs

If you do something like:

git -c core.foo="value with = in it" ...

we would split your option on "=" into three fields and
throw away the third one. With this patch we correctly take
everything after the first "=" as the value (keys cannot
have an equals sign in them, so the parsing is unambiguous).

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

strbuf_split: add a max parameterJeff King Thu, 9 Jun 2011 15:51:22 +0000 (11:51 -0400)

strbuf_split: add a max parameter

Sometimes when splitting, you only want a limited number of
fields, and for the final field to contain "everything
else", even if it includes the delimiter.

This patch introduces strbuf_split_max, which provides a
"max number of fields" parameter; it behaves similarly to
perl's "split" with a 3rd field.

The existing 2-argument form of strbuf_split is retained for
compatibility and ease-of-use.

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

upload-archive: allow user to turn off filtersJeff King Wed, 22 Jun 2011 03:17:35 +0000 (23:17 -0400)

upload-archive: allow user to turn off filters

Some tar filters may be very expensive to run, so sites do
not want to expose them via upload-archive. This patch lets
users configure tar.<filter>.remote to turn them off.

By default, gzip filters are left on, as they are about as
expensive as creating zip archives.

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

archive: provide builtin .tar.gz filterJeff King Wed, 22 Jun 2011 01:27:35 +0000 (21:27 -0400)

archive: provide builtin .tar.gz filter

This works exactly as if the user had configured it via:

[tar "tgz"]
command = gzip -cn
[tar "tar.gz"]
command = gzip -cn

but since it is so common, it's convenient to have it
builtin without the user needing to do anything.

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

archive: implement configurable tar filtersJeff King Wed, 22 Jun 2011 01:26:31 +0000 (21:26 -0400)

archive: implement configurable tar filters

It's common to pipe the tar output produce by "git archive"
through gzip or some other compressor. Locally, this can
easily be done by using a shell pipe. When requesting a
remote archive, though, it cannot be done through the
upload-archive interface.

This patch allows configurable tar filters, so that one
could define a "tar.gz" format that automatically pipes tar
output through gzip.

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

archive: refactor file extension format-guessingJeff King Wed, 22 Jun 2011 01:25:25 +0000 (21:25 -0400)

archive: refactor file extension format-guessing

Git-archive will guess a format from the output filename if
no format is explicitly given. The current function just
hardcodes "zip" to the zip format, and leaves everything
else NULL (which will default to tar). Since we are about
to add user-specified formats, we need to be more flexible.
The new rule is "if a filename ends with a dot and the name
of a format, it matches that format". For the existing "tar"
and "zip" formats, this is identical to the current
behavior. For new user-specified formats, this will do what
the user expects if they name their formats appropriately.

Because we will eventually start matching arbitrary
user-specified extensions that may include dots, the strrchr
search for the final dot is not sufficient. We need to do an
actual suffix match with each extension.

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

archive: move file extension format-guessing lowerJeff King Wed, 22 Jun 2011 01:24:48 +0000 (21:24 -0400)

archive: move file extension format-guessing lower

The process for guessing an archive output format based on
the filename is something like this:

a. parse --output in cmd_archive; check the filename
against a static set of mapping heuristics (right now
it just matches ".zip" for zip files).

b. if found, stick a fake "--format=zip" at the beginning
of the arguments list (if the user did specify a
--format manually, the later option will override our
fake one)

c. if it's a remote call, ship the arguments to the remote
(including the fake), which will call write_archive on
their end

d. if it's local, ship the arguments to write_archive
locally

There are two problems:

1. The set of mappings is static and at too high a level.
The write_archive level is going to check config for
user-defined formats, some of which will specify
extensions. We need to delay lookup until those are
parsed, so we can match against them.

2. For a remote archive call, our set of mappings (or
formats) may not match the remote side's. This is OK in
practice right now, because all versions of git
understand "zip" and "tar". But as new formats are
added, there is going to be a mismatch between what the
client can do and what the remote server can do.

To fix (1), this patch refactors the location guessing to
happen at the write_archive level, instead of the
cmd_archive level. So instead of sticking a fake --format
field in the argv list, we actually pass a "name hint" down
the callchain; this hint is used at the appropriate time to
guess the format (if one hasn't been given already).

This patch leaves (2) unfixed. The name_hint is converted to
a "--format" option as before, and passed to the remote.
This means the local side's idea of how extensions map to
formats will take precedence.

Another option would be to pass the name hint to the remote
side and let the remote choose. This isn't a good idea for
two reasons:

1. There's no room in the protocol for passing that
information. We can pass a new argument, but older
versions of git on the server will choke on it.

2. Letting the remote side decide creates a silent
inconsistency in user experience. Consider the case
that the locally installed git knows about the "tar.gz"
format, but a remote server doesn't.

Running "git archive -o foo.tar.gz" will use the tar.gz
format. If we use --remote, and the local side chooses
the format, then we send "--format=tar.gz" to the
remote, which will complain about the unknown format.
But if we let the remote side choose the format, then
it will realize that it doesn't know about "tar.gz" and
output uncompressed tar without even issuing a warning.

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

archive: pass archiver struct to write_archive callbackJeff King Wed, 22 Jun 2011 01:24:07 +0000 (21:24 -0400)

archive: pass archiver struct to write_archive callback

The current archivers are very static; when you are in the
write_tar_archive function, you know you are writing a tar.
However, to facilitate runtime-configurable archivers
that will share a common write function we need to tell the
function which archiver was used.

As a convenience, we also provide an opaque data pointer in
the archiver struct so that individual archivers can put
something useful there when they register themselves.
Technically they could just use the "name" field to look in
an internal map of names to data, but this is much simpler.

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

archive: refactor list of archive formatsJeff King Wed, 22 Jun 2011 01:23:33 +0000 (21:23 -0400)

archive: refactor list of archive formats

Most of the tar and zip code was nicely split out into two
abstracted files which knew only about their specific
formats. The entry point to this code was a single "write
archive" function.

However, as these basic formats grow more complex (e.g., by
handling multiple file extensions and format names), a
static list of the entry point functions won't be enough.
Instead, let's provide a way for the tar and zip code to
tell the main archive code what they support by registering
archiver names and functions.

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