gitweb.git
Unroll the loop over passesMichael Haggerty Fri, 12 Aug 2011 21:43:10 +0000 (23:43 +0200)

Unroll the loop over passes

The passes no longer share much code, and the unrolled code is easier
to understand.

Use a new index variable instead of num_attr for the second loop, as
we are no longer counting attributes but rather indexing through them.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Change while loop into for loopMichael Haggerty Fri, 12 Aug 2011 21:43:09 +0000 (23:43 +0200)

Change while loop into for loop

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Determine the start of the states outside of the pass... Michael Haggerty Fri, 12 Aug 2011 21:43:08 +0000 (23:43 +0200)

Determine the start of the states outside of the pass loop

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Change parse_attr() to take a pointer to struct attr_stateMichael Haggerty Fri, 12 Aug 2011 21:43:07 +0000 (23:43 +0200)

Change parse_attr() to take a pointer to struct attr_state

parse_attr() only needs access to the attr_state to which it should
store its results, not to the whole match_attr structure. This change
also removes the need for it to know num_attr. Change its signature
accordingly and add a comment.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Increment num_attr in parse_attr_line(), not parse_attr()Michael Haggerty Fri, 12 Aug 2011 21:43:06 +0000 (23:43 +0200)

Increment num_attr in parse_attr_line(), not parse_attr()

num_attr is incremented iff parse_attr() returns non-NULL. So do the
counting in parse_attr_line() instead of within parse_attr(). This
allows an integer rather than a pointer to an integer to be passed to
parse_attr().

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Document struct match_attrMichael Haggerty Fri, 12 Aug 2011 21:43:05 +0000 (23:43 +0200)

Document struct match_attr

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add a file commentMichael Haggerty Fri, 12 Aug 2011 21:43:04 +0000 (23:43 +0200)

Add a file comment

Consolidate here a few general comments plus links to other
documentation. Delete a comment with an out-of-date description of
the .gitattributes file format.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes to 1.7.7Junio C Hamano Thu, 11 Aug 2011 19:12:22 +0000 (12:12 -0700)

Update draft release notes to 1.7.7

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

Merge branch 'cb/partial-commit-relative-pathspec'Junio C Hamano Thu, 11 Aug 2011 18:04:28 +0000 (11:04 -0700)

Merge branch 'cb/partial-commit-relative-pathspec'

* cb/partial-commit-relative-pathspec:
commit: allow partial commits with relative paths

Merge branch 'jk/fast-export-quote-path'Junio C Hamano Thu, 11 Aug 2011 18:03:16 +0000 (11:03 -0700)

Merge branch 'jk/fast-export-quote-path'

* jk/fast-export-quote-path:
fast-export: quote paths in output

Merge branch 'rc/maint-http-wrong-free'Junio C Hamano Thu, 11 Aug 2011 18:03:13 +0000 (11:03 -0700)

Merge branch 'rc/maint-http-wrong-free'

* rc/maint-http-wrong-free:
Makefile: some changes for http-related flag documentation
http.c: fix an invalid free()

Conflicts:
Makefile

Merge branch 'rs/grep-function-context'Junio C Hamano Thu, 11 Aug 2011 18:03:09 +0000 (11:03 -0700)

Merge branch 'rs/grep-function-context'

* rs/grep-function-context:
grep: long context options
grep: add option to show whole function as context

Merge branch 'ef/ipv4-connect-error-report'Junio C Hamano Thu, 11 Aug 2011 18:03:06 +0000 (11:03 -0700)

Merge branch 'ef/ipv4-connect-error-report'

* ef/ipv4-connect-error-report:
connect: only log if all attempts failed (ipv4)

Merge branch 'oa/pull-reflog'Junio C Hamano Mon, 8 Aug 2011 19:33:36 +0000 (12:33 -0700)

Merge branch 'oa/pull-reflog'

* oa/pull-reflog:
pull: remove extra space from reflog message

Conflicts:
git-pull.sh

Merge branch 'ms/reflog-show-is-default'Junio C Hamano Mon, 8 Aug 2011 19:33:35 +0000 (12:33 -0700)

Merge branch 'ms/reflog-show-is-default'

* ms/reflog-show-is-default:
reflog: actually default to subcommand 'show'

Merge branch 'jl/submodule-status-summary-doc'Junio C Hamano Mon, 8 Aug 2011 19:33:35 +0000 (12:33 -0700)

Merge branch 'jl/submodule-status-summary-doc'

* jl/submodule-status-summary-doc:
Documentation/submodule: add command references and update options

Merge branch 'jn/gitweb-config-list-case'Junio C Hamano Mon, 8 Aug 2011 19:33:35 +0000 (12:33 -0700)

Merge branch 'jn/gitweb-config-list-case'

* jn/gitweb-config-list-case:
gitweb: Git config keys are case insensitive, make config search too

Merge branch 'jl/submodule-update-quiet'Junio C Hamano Mon, 8 Aug 2011 19:33:34 +0000 (12:33 -0700)

Merge branch 'jl/submodule-update-quiet'

* jl/submodule-update-quiet:
submodule: update and add must honor --quiet flag

Merge branch 'js/ls-tree-error'Junio C Hamano Mon, 8 Aug 2011 19:33:34 +0000 (12:33 -0700)

Merge branch 'js/ls-tree-error'

* js/ls-tree-error:
Ensure git ls-tree exits with a non-zero exit code if read_tree_recursive fails.
Add a test to check that git ls-tree sets non-zero exit code on error.

Merge branch 'jn/gitweb-system-config'Junio C Hamano Mon, 8 Aug 2011 19:33:34 +0000 (12:33 -0700)

Merge branch 'jn/gitweb-system-config'

* jn/gitweb-system-config:
gitweb: Introduce common system-wide settings for convenience

Merge branch 'jk/reset-reflog-message-fix'Junio C Hamano Mon, 8 Aug 2011 19:33:33 +0000 (12:33 -0700)

Merge branch 'jk/reset-reflog-message-fix'

* jk/reset-reflog-message-fix:
reset: give better reflog messages

Merge branch 'jc/diff-index-refactor'Junio C Hamano Mon, 8 Aug 2011 19:33:33 +0000 (12:33 -0700)

Merge branch 'jc/diff-index-refactor'

* jc/diff-index-refactor:
diff-lib: refactor run_diff_index() and do_diff_cache()
diff-lib: simplify do_diff_cache()

Merge branch 'maint'Junio C Hamano Mon, 8 Aug 2011 19:24:16 +0000 (12:24 -0700)

Merge branch 'maint'

* maint:
filter-branch: Export variable `workdir' for --commit-filter
Documentation/Makefile: add *.pdf to `clean' target
Documentation: ignore *.pdf files

filter-branch: Export variable `workdir' for --commit... Michael Witten Sun, 7 Aug 2011 02:44:43 +0000 (02:44 +0000)

filter-branch: Export variable `workdir' for --commit-filter

According to `git help filter-branch':

--commit-filter <command>
...
You can use the _map_ convenience function in this filter,
and other convenience functions, too...
...

However, it turns out that `map' hasn't been usable because it depends
on the variable `workdir', which is not propogated to the environment
of the shell that runs the commit-filter <command> because the
shell is created via a simple-command rather than a compound-command
subshell:

@SHELL_PATH@ -c "$filter_commit" "git commit-tree" \
$(git write-tree) $parentstr < ../message > ../map/$commit ||
die "could not write rewritten commit"

One solution is simply to export `workdir'. However, it seems rather
heavy-handed to export `workdir' to the environments of all commands,
so instead this commit exports `workdir' for only the duration of the
shell command in question:

workdir=$workdir @SHELL_PATH@ -c "$filter_commit" "git commit-tree" \
$(git write-tree) $parentstr < ../message > ../map/$commit ||
die "could not write rewritten commit"

Signed-off-by: Michael Witten <mfwitten@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/Makefile: add *.pdf to `clean' targetEmilio G. Cota Mon, 8 Aug 2011 08:33:05 +0000 (04:33 -0400)

Documentation/Makefile: add *.pdf to `clean' target

user-manual.pdf is not removed by `make clean'; fix it.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: ignore *.pdf filesEmilio G. Cota Mon, 8 Aug 2011 08:33:04 +0000 (04:33 -0400)

Documentation: ignore *.pdf files

user-manual.pdf is generated by the build and therefore
should be ignored by git.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-export: quote paths in outputJeff King Fri, 5 Aug 2011 22:36:22 +0000 (16:36 -0600)

fast-export: quote paths in output

Many pathnames in a fast-import stream need to be quoted. In
particular:

1. Pathnames at the end of an "M" or "D" line need quoting
if they contain a LF or start with double-quote.

2. Pathnames on a "C" or "R" line need quoting as above,
but also if they contain spaces.

For (1), we weren't quoting at all. For (2), we put
double-quotes around the paths to handle spaces, but ignored
the possibility that they would need further quoting.

This patch checks whether each pathname needs c-style
quoting, and uses it. This is slightly overkill for (1),
which doesn't actually need to quote many characters that
vanilla c-style quoting does. However, it shouldn't hurt, as
any implementation needs to be ready to handle quoted
strings anyway.

In addition to adding a test, we have to tweak a test which
blindly assumed that case (2) would always use
double-quotes, whether it needed to or not.

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

Merge branch 'tc/minix'Junio C Hamano Fri, 5 Aug 2011 21:55:00 +0000 (14:55 -0700)

Merge branch 'tc/minix'

* tc/minix:
Makefile: add Minix configuration options.

Merge branch 'jc/pack-order-tweak'Junio C Hamano Fri, 5 Aug 2011 21:54:57 +0000 (14:54 -0700)

Merge branch 'jc/pack-order-tweak'

* jc/pack-order-tweak:
pack-objects: optimize "recency order"
core: log offset pack data accesses happened

docs: put listed example commands in backticksJeff King Thu, 4 Aug 2011 02:13:29 +0000 (20:13 -0600)

docs: put listed example commands in backticks

Many examples of git command invocation are given in asciidoc listing
blocks, which makes them monospaced and avoids further interpretation of
special characters. Some manpages make a list of examples, like:

git foo::
Run git foo.

git foo -q::
Use the "-q" option.

to quickly show many variants. However, they can sometimes be hard to
read, because they are shown in a proportional-width font (so, for
example, seeing the difference between "-- foo" and "--foo" can be
difficult).

This patch puts all such examples into backticks, which gives the
equivalent formatting to a listing block (i.e., monospaced and without
character interpretation).

As a bonus, this also fixes an example in the git-push manpage, in which
"git push origin :::" was accidentally considered a newly-indented list,
and not a list item with "git push origin :" in it.

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

gitweb: pass string after encoding in utf-8 to syntax... 张忠山 Thu, 4 Aug 2011 15:52:55 +0000 (23:52 +0800)

gitweb: pass string after encoding in utf-8 to syntax highlighter

Otherwise the highlight filter would work on a corrupt byte sequence.

Signed-off-by: 张忠山 <zzs213@126.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add option hooks.diffopts to customize change summary... Jon Jensen Thu, 4 Aug 2011 03:36:08 +0000 (21:36 -0600)

Add option hooks.diffopts to customize change summary in post-receive-email

This makes it easy to customize the git diff-tree options, for example
to include -p to include inline diffs.

It defaults to the current options "--stat --summary --find-copies-harder"
and thus is backward-compatible.

Signed-off-by: Jon Jensen <jon@endpoint.com>
Improved-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Wed, 3 Aug 2011 21:16:17 +0000 (14:16 -0700)

Merge branch 'maint'

* maint:
add gitignore entry to description about how to write a builtin
gitattributes: Reword "attribute macro" to "macro attribute"
gitattributes: Clarify discussion of attribute macros

add gitignore entry to description about how to write... Heiko Voigt Wed, 3 Aug 2011 18:06:17 +0000 (20:06 +0200)

add gitignore entry to description about how to write a builtin

If the author forgets the gitignore entry the built result will show up
as new file in the git working directory.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: some changes for http-related flag documentationTay Ray Chuan Wed, 3 Aug 2011 12:07:57 +0000 (20:07 +0800)

Makefile: some changes for http-related flag documentation

Rename git-http-pull to git-http-fetch. This was passed over in 215a7ad
(Big tool rename, Wed Sep 7 17:26:23 2005 -0700).

Also, distinguish between dumb and smart in flag docs, as the "warnings"
in NO_CURL and NO_EXPACT are no longer accurate given the introduction
of smart http(s).

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http.c: fix an invalid free()Tay Ray Chuan Wed, 3 Aug 2011 11:54:03 +0000 (19:54 +0800)

http.c: fix an invalid free()

Remove a free() on the static buffer returned by sha1_file_name().

While we're at it, replace xmalloc() calls on the structs
http_(object|pack)_request with xcalloc() so that pointers in the
structs get initialized to NULL. That way, free()'s are safe - for
example, a free() on the url string member when aborting.

This fixes an invalid free().

Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Helped-by: Jeff King peff@peff.net
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitattributes: Reword "attribute macro" to "macro attri... Michael Haggerty Wed, 3 Aug 2011 13:41:30 +0000 (15:41 +0200)

gitattributes: Reword "attribute macro" to "macro attribute"

The new wording makes it clearer that such a beast is an attribute in
addition to being a macro (as opposed to being only a macro that is
used for attributes).

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitattributes: Clarify discussion of attribute macrosMichael Haggerty Wed, 3 Aug 2011 13:41:29 +0000 (15:41 +0200)

gitattributes: Clarify discussion of attribute macros

In particular, make it clear that attribute macros are themselves
recorded as attributes in addition to setting other attributes.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Skip archive --remote tests on WindowsJohannes Sixt Wed, 3 Aug 2011 08:20:08 +0000 (10:20 +0200)

Skip archive --remote tests on Windows

These depend on a working git-upload-archive, which is broken on Windows,
because it depends on fork().

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

commit: allow partial commits with relative pathsClemens Buchacher Sat, 30 Jul 2011 17:13:47 +0000 (19:13 +0200)

commit: allow partial commits with relative paths

In order to do partial commits, git-commit overlays a tree on the
cache and checks pathspecs against the result. Currently, the
overlaying is done using "prefix" which prevents relative pathspecs
with ".." and absolute pathspec from matching when they refer to
files not under "prefix" and absent from the index, but still in
the tree (i.e. files staged for removal).

The point of providing a prefix at all is performance optimization.
If we say there is no common prefix for the files of interest, then
we have to read the entire tree into the index.

But even if we cannot use the working directory as a prefix, we can
still figure out if there is a common prefix for all given paths,
and use that instead. The pathspec_prefix() routine from ls-files.c
does exactly that.

Any use of global variables is removed from pathspec_prefix() so
that it can be called from commit.c.

Reported-by: Reuben Thomas <rrt@sc3d.org>
Analyzed-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

grep: long context optionsRené Scharfe Mon, 1 Aug 2011 17:22:52 +0000 (19:22 +0200)

grep: long context options

Take long option names for -A (--after-context), -B (--before-context)
and -C (--context) from GNU grep and add a similar long option name
for -W (--function-context).

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

grep: add option to show whole function as contextRené Scharfe Mon, 1 Aug 2011 17:20:53 +0000 (19:20 +0200)

grep: add option to show whole function as context

Add a new option, -W, to show the whole surrounding function of a match.

It uses the same regular expressions as -p and diff to find the beginning
of sections.

Currently it will not display comments in front of a function, but those
that are following one. Despite this shortcoming it is already useful,
e.g. to simply see a more complete applicable context or to extract whole
functions.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pull: remove extra space from reflog messageOri Avtalion Fri, 29 Jul 2011 07:19:26 +0000 (10:19 +0300)

pull: remove extra space from reflog message

When executing "git pull" with no arguments, the reflog message was:
"pull : Fast-forward"

Signed-off-by: Ori Avtalion <ori@avtalion.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/submodule: add command references and... Jens Lehmann Mon, 1 Aug 2011 20:49:21 +0000 (22:49 +0200)

Documentation/submodule: add command references and update options

Reference the "git diff" and "git status" commands where they learned
functionality that in earlier git versions was only available through the
'summary' and 'status' subcommands of "git submodule".

The short option '-n' for '--summary-limit' was missing from the synopsis
and the --init option was missing from the "options" section, add those
there. And while at it, quote all options in backticks so they are
decorated properly in the output formats which support that.

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

Merge branch 'vi/make-test-vector-less-specific'Junio C Hamano Mon, 1 Aug 2011 22:00:38 +0000 (15:00 -0700)

Merge branch 'vi/make-test-vector-less-specific'

* vi/make-test-vector-less-specific:
tests: cleanup binary test vector files

Merge branch 'jk/clone-detached'Junio C Hamano Mon, 1 Aug 2011 22:00:35 +0000 (15:00 -0700)

Merge branch 'jk/clone-detached'

* jk/clone-detached:
clone: always fetch remote HEAD
make copy_ref globally available
consider only branches in guess_remote_head
t: add tests for cloning remotes with detached HEAD

Merge branch 'jc/streaming-filter'Junio C Hamano Mon, 1 Aug 2011 22:00:29 +0000 (15:00 -0700)

Merge branch 'jc/streaming-filter'

* jc/streaming-filter:
streaming: free git_istream upon closing

Merge branch 'sr/transport-helper-fix'Junio C Hamano Mon, 1 Aug 2011 22:00:14 +0000 (15:00 -0700)

Merge branch 'sr/transport-helper-fix'

* sr/transport-helper-fix: (21 commits)
transport-helper: die early on encountering deleted refs
transport-helper: implement marks location as capability
transport-helper: Use capname for refspec capability too
transport-helper: change import semantics
transport-helper: update ref status after push with export
transport-helper: use the new done feature where possible
transport-helper: check status code of finish_command
transport-helper: factor out push_update_refs_status
fast-export: support done feature
fast-import: introduce 'done' command
git-remote-testgit: fix error handling
git-remote-testgit: only push for non-local repositories
remote-curl: accept empty line as terminator
remote-helpers: export GIT_DIR variable to helpers
git_remote_helpers: push all refs during a non-local export
transport-helper: don't feed bogus refs to export push
git-remote-testgit: import non-HEAD refs
t5800: document some non-functional parts of remote helpers
t5800: use skip_all instead of prereq
t5800: factor out some ref tests
...

Merge branch 'jc/maint-reset-unmerged-path'Junio C Hamano Mon, 1 Aug 2011 22:00:08 +0000 (15:00 -0700)

Merge branch 'jc/maint-reset-unmerged-path'

* jc/maint-reset-unmerged-path:
reset [<commit>] paths...: do not mishandle unmerged paths

Merge branch 'maint'Junio C Hamano Mon, 1 Aug 2011 21:45:02 +0000 (14:45 -0700)

Merge branch 'maint'

* maint:
connect: correctly number ipv6 network adapter

Merge branch 'nk/ref-doc' into maintJunio C Hamano Mon, 1 Aug 2011 21:44:24 +0000 (14:44 -0700)

Merge branch 'nk/ref-doc' into maint

* nk/ref-doc:
glossary: clarify description of HEAD
glossary: update description of head and ref
glossary: update description of "tag"
git.txt: de-emphasize the implementation detail of a ref
check-ref-format doc: de-emphasize the implementation detail of a ref
git-remote.txt: avoid sounding as if loose refs are the only ones in the world
git-remote.txt: fix wrong remote refspec

Merge branch 'jl/maint-fetch-recursive-fix' into maintJunio C Hamano Mon, 1 Aug 2011 21:44:17 +0000 (14:44 -0700)

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

* 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 Mon, 1 Aug 2011 21:44:13 +0000 (14:44 -0700)

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

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

Merge branch 'jc/legacy-loose-object' into maintJunio C Hamano Mon, 1 Aug 2011 21:43:58 +0000 (14:43 -0700)

Merge branch 'jc/legacy-loose-object' into maint

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

Merge branch 'an/shallow-doc' into maintJunio C Hamano Mon, 1 Aug 2011 21:43:53 +0000 (14:43 -0700)

Merge branch 'an/shallow-doc' into maint

* 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.

Merge branch 'jc/maint-1.7.3-checkout-describe' into... Junio C Hamano Mon, 1 Aug 2011 21:43:18 +0000 (14:43 -0700)

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

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

reflog: actually default to subcommand 'show'Michael Schubert Mon, 1 Aug 2011 11:20:42 +0000 (13:20 +0200)

reflog: actually default to subcommand 'show'

The reflog manpage says:

git reflog [show] [log-options] [<ref>]

the subcommand 'show' is the default "in the absence of any
subcommands". Currently this is only true if the user provided either
at least one option or no additional argument at all. For example:

git reflog master

won't work. Change this by actually calling cmd_log_reflog in
absence of any subcommand.

Signed-off-by: Michael Schubert <mschub@elegosoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

connect: only log if all attempts failed (ipv4)Erik Faye-Lund Mon, 1 Aug 2011 11:16:10 +0000 (13:16 +0200)

connect: only log if all attempts failed (ipv4)

In 63a995b (Do not log unless all connect() attempts fail), a
mechanism to only log connection errors if all attempts failed
was introduced for the IPv6 code-path, but not for the IPv4 one.

Introduce a matching mechanism so IPv4-users also benefit from
this noise-reduction.

Move the call to socket after filling in sa, to make it more
apparent that errno can't change in between.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint' into ef/ipv4-connect-error-reportJunio C Hamano Mon, 1 Aug 2011 17:49:40 +0000 (10:49 -0700)

Merge branch 'maint' into ef/ipv4-connect-error-report

* maint:
connect: correctly number ipv6 network adapter

connect: correctly number ipv6 network adapterErik Faye-Lund Mon, 1 Aug 2011 11:16:09 +0000 (13:16 +0200)

connect: correctly number ipv6 network adapter

In ba50532, the variable 'cnt' was added to both the IPv6 and the
IPv4 version of git_tcp_connect_sock, intended to identify which
network adapter the connection failed on. But in the IPv6 version,
the variable was never increased, leaving it constantly at zero.

This behaviour isn't very useful, so let's fix it by increasing
the variable at every loop-iteration.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: commit time should be most recent p4 change... Pete Wyckoff Sun, 31 Jul 2011 13:45:55 +0000 (09:45 -0400)

git-p4: commit time should be most recent p4 change time

When importing a repo, the time on the initial commit had been
just "now". But this causes problems when trying to share among
git-p4 repos that were created identically, although at different
times. Instead, use the time in the top-most p4 change as the
time for the git import commit.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: one test missing config git-p4.skipSubmitEditCheckPete Wyckoff Sun, 31 Jul 2011 13:45:38 +0000 (09:45 -0400)

git-p4: one test missing config git-p4.skipSubmitEditCheck

Add this missing line in one of the tests. Otherwise, on fast
machines, the following git-p4 commit will complain that nobody
edited the submission message.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: add missing && in testPete Wyckoff Sun, 31 Jul 2011 13:45:17 +0000 (09:45 -0400)

git-p4: add missing && in test

Signed-off-by: Pete Wyckoff <pw@padd.com>
Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: use test_when_finished in testsPete Wyckoff Sun, 31 Jul 2011 13:44:50 +0000 (09:44 -0400)

git-p4: use test_when_finished in tests

Cleanup nicely when tests fail. This avoids many duplicated
lines in the tests, and adds cleanup in a couple of tests that
did not have it. When one fails, now all the rest will not
fail too.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Mon, 1 Aug 2011 01:57:32 +0000 (18:57 -0700)

Merge branch 'maint'

* maint:
Break down no-lstat() condition checks in verify_uptodate()
t7400: fix bogus test failure with symlinked trash
Documentation: clarify the invalidated tree entry format

Break down no-lstat() condition checks in verify_uptodate()Nguyễn Thái Ngọc Duy Sat, 30 Jul 2011 03:55:05 +0000 (10:55 +0700)

Break down no-lstat() condition checks in verify_uptodate()

Make it easier to grok under what conditions we can skip lstat().

While at there, shorten ie_match_stat() line for the sake of my eyes.

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

t7400: fix bogus test failure with symlinked trashJeff King Sat, 30 Jul 2011 15:05:54 +0000 (09:05 -0600)

t7400: fix bogus test failure with symlinked trash

One of the tests in t7400 fails if the trash directory has a
symlink anywhere in its path. E.g.:

$ mkdir /tmp/git-test
$ mkdir /tmp/git-test/real
$ ln -s real /tmp/git-test/link

$ ./t7400-submodule-basic --root=/tmp/git-test/real
...
# passed all 44 test(s)

$ ./t7400-submodule-basic --root=/tmp/git-test/link
...
not ok - 41 use superproject as upstream when path is relative and no url is set there

The failing test does:

git submodule add ../repo relative &&
...
git submodule sync relative &&
test "$(git config submodule.relative.url)" = "$submodurl/repo"

where $submodurl comes from the $TRASH_DIRECTORY the user
gave us. However, git will resolve symlinks when converting
the relative path into an absolute one, leading them to be
textually different (even though they point to the same
directory).

Fix this by asking pwd to canonicalize the name of the trash
directory for us.

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

gitweb: Git config keys are case insensitive, make... Jakub Narebski Thu, 28 Jul 2011 21:38:03 +0000 (23:38 +0200)

gitweb: Git config keys are case insensitive, make config search too

"git config -z -l" that gitweb uses in git_parse_project_config() to
populate %config hash returns section and key names of config
variables in lowercase (they are case insensitive). When checking
%config in git_get_project_config() we have to take it into account.

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

Documentation: clarify the invalidated tree entry formatCarlos Martín Nieto Tue, 26 Jul 2011 12:27:57 +0000 (14:27 +0200)

Documentation: clarify the invalidated tree entry format

When the entry_count is -1, the tree is invalidated and therefore has
not associated hash (or object name). Explicitly state that the next
entry starts after the newline.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule: update and add must honor --quiet flagJens Lehmann Tue, 26 Jul 2011 21:39:03 +0000 (23:39 +0200)

submodule: update and add must honor --quiet flag

When using the --quiet flag "git submodule update" and "git submodule add"
didn't behave as the documentation stated. They printed progress output
from the clone, even though they should only print error messages.

Fix that by passing the -q flag to git clone in module_clone() when the
GIT_QUIET variable is set. Two tests in t7400 have been modified to test
that behavior.

Reported-by: Daniel Holtmann-Rice <flyingtabmow@gmail.com>
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ensure git ls-tree exits with a non-zero exit code... Jon Seymour Sun, 24 Jul 2011 14:59:14 +0000 (00:59 +1000)

Ensure git ls-tree exits with a non-zero exit code if read_tree_recursive fails.

In the case of a corrupt repository, git ls-tree may report an error but
presently it exits with a code of 0.

This change uses the return code of read_tree_recursive instead.

Improved-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Sun, 24 Jul 2011 23:23:01 +0000 (16:23 -0700)

Merge branch 'maint'

* maint:
tests: print failed test numbers at the end of the test run

gitweb: Introduce common system-wide settings for conve... Jakub Narebski Sun, 24 Jul 2011 22:29:18 +0000 (00:29 +0200)

gitweb: Introduce common system-wide settings for convenience

Because of backward compatibility we cannot change gitweb to always
use /etc/gitweb.conf (i.e. even if gitweb_config.perl exists). For
common system-wide settings we therefore need separate configuration
file: /etc/gitweb-common.conf.

Long description:

gitweb currently obtains configuration from the following sources:

1. per-instance configuration file (default: gitweb_conf.perl)
2. system-wide configuration file (default: /etc/gitweb.conf)

If per-instance configuration file exists, then system-wide
configuration is _not used at all_. This is quite untypical and
suprising behavior.

Moreover it is different from way git itself treats /etc/git.conf. It
reads in stuff from /etc/git.conf and then local repos can change or
override things as needed. In fact this is quite beneficial, because
it gives site admins a simple and easy way to give an automatic hint
to a repo about things the admin would like.

On the other hand changing current behavior may lead to the situation,
where something in /etc/gitweb.conf may interfere with unintended
interaction in the local repository. One solution would be to
_require_ to do explicit include; with read_config_file() it is now
easy, as described in gitweb/README (description introduced in this
commit).

But as J.H. noticed we cannot ask people to modify their per-instance
gitweb config file to include system-wide settings, nor we can require
them to do this.

Therefore, as proposed by Junio, for gitweb to have centralized config
elements while retaining backwards compatibility, introduce separate
common system-wide configuration file, by default /etc/gitweb-common.conf

Noticed-by: Drew Northup <drew.northup@maine.edu>
Helped-by: John 'Warthog9' Hawley <warthog9@kernel.org>
Inspired-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: print failed test numbers at the end of the... Jens Lehmann Sun, 24 Jul 2011 13:35:54 +0000 (15:35 +0200)

tests: print failed test numbers at the end of the test run

On modern multi-core processors "make test" is often run in multiple jobs.
If one of them fails the test run does stop, but the concurrently running
tests finish their run. It is rather easy to find out which test failed by
doing a "ls -d t/trash*". But that only works when you don't use the "-i"
option to "make test" because you want to get an overview of all failing
tests. In that case all thrash directories are deleted end and the
information which tests failed is lost.

If one or more tests failed, print a list of them before the test summary:

failed test(s): t1000 t6500

fixed 0
success 7638
failed 3
broken 49
total 7723

This makes it possible to just run the test suite with -i and collect all
failed test scripts at the end for further examination.

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

Add a test to check that git ls-tree sets non-zero... Jon Seymour Sun, 24 Jul 2011 14:59:13 +0000 (00:59 +1000)

Add a test to check that git ls-tree sets non-zero exit code on error.

Expected to fail at this commit, fixed by subsequent commit.

Additional tests of adhoc or uncategorised nature should be added to this
file.

Improved-by: Jens Lehmann <Jens.Lehmann@web.de>
Improved-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes to 1.7.7Junio C Hamano Fri, 22 Jul 2011 22:32:03 +0000 (15:32 -0700)

Update draft release notes to 1.7.7

The third batch.

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

Merge branch 'dc/stash-con-untracked'Junio C Hamano Fri, 22 Jul 2011 21:46:28 +0000 (14:46 -0700)

Merge branch 'dc/stash-con-untracked'

* dc/stash-con-untracked:
stash: Add --include-untracked option to stash and remove all untracked files

Conflicts:
git-stash.sh

Merge branch 'jk/tag-contains-ab'Junio C Hamano Fri, 22 Jul 2011 21:45:19 +0000 (14:45 -0700)

Merge branch 'jk/tag-contains-ab'

* jk/tag-contains-ab:
Revert clock-skew based attempt to optimize tag --contains traversal
git skew: a tool to find how big a clock skew exists in the history
default core.clockskew variable to one day
limit "contains" traversals based on commit timestamp
tag: speed up --contains calculation

Merge branch 'dz/connect-error-report'Junio C Hamano Fri, 22 Jul 2011 21:44:28 +0000 (14:44 -0700)

Merge branch 'dz/connect-error-report'

* dz/connect-error-report:
Do not log unless all connect() attempts fail

Merge branch 'mz/doc-rebase-abort'Junio C Hamano Fri, 22 Jul 2011 21:44:08 +0000 (14:44 -0700)

Merge branch 'mz/doc-rebase-abort'

* mz/doc-rebase-abort:
rebase: clarify "restore the original branch"

Merge branch 'bw/log-all-ref-updates-doc'Junio C Hamano Fri, 22 Jul 2011 21:43:51 +0000 (14:43 -0700)

Merge branch 'bw/log-all-ref-updates-doc'

* bw/log-all-ref-updates-doc:
Documentation: clearly specify what refs are honored by core.logAllRefUpdates

Merge branch 'js/maint-add-path-stat-pwd'Junio C Hamano Fri, 22 Jul 2011 21:43:36 +0000 (14:43 -0700)

Merge branch 'js/maint-add-path-stat-pwd'

* js/maint-add-path-stat-pwd:
get_pwd_cwd(): Do not trust st_dev/st_ino blindly

Merge branch 'ms/help-unknown'Junio C Hamano Fri, 22 Jul 2011 21:43:21 +0000 (14:43 -0700)

Merge branch 'ms/help-unknown'

* ms/help-unknown:
help_unknown_cmd: do not propose an "unknown" cmd

Merge branch 'mz/doc-synopsis-verse'Junio C Hamano Fri, 22 Jul 2011 21:43:13 +0000 (14:43 -0700)

Merge branch 'mz/doc-synopsis-verse'

* mz/doc-synopsis-verse:
Documentation: use [verse] for SYNOPSIS sections

Conflicts:
Documentation/git-mergetool--lib.txt

Merge branch 'jc/checkout-reflog-fix'Junio C Hamano Fri, 22 Jul 2011 21:43:03 +0000 (14:43 -0700)

Merge branch 'jc/checkout-reflog-fix'

* jc/checkout-reflog-fix:
checkout: do not write bogus reflog entry out

Merge branch 'jc/maint-mergetool-read-fix'Junio C Hamano Fri, 22 Jul 2011 21:42:38 +0000 (14:42 -0700)

Merge branch 'jc/maint-mergetool-read-fix'

* jc/maint-mergetool-read-fix:
mergetool: check return value from read

streaming: free git_istream upon closingJeff King Fri, 22 Jul 2011 17:00:03 +0000 (11:00 -0600)

streaming: free git_istream upon closing

Kirill Smelkov noticed that post-1.7.6 "git checkout"
started leaking tons of memory. The streaming_write_entry
function properly calls close_istream(), but that function
did not actually free() the allocated git_istream struct.

The git_istream struct is totally opaque to calling code,
and must be heap-allocated by open_istream. Therefore it's
not appropriate for callers to have to free it.

This patch makes close_istream() into "close and de-allocate
all associated resources". We could add a new "free_istream"
call, but there's not much point in letting callers inspect
the istream after close. And this patch's semantics make us
match fopen/fclose, which is well-known and understood.

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

Merge branch 'jn/gitweb-search'Junio C Hamano Fri, 22 Jul 2011 21:25:19 +0000 (14:25 -0700)

Merge branch 'jn/gitweb-search'

* jn/gitweb-search:
gitweb: Make git_search_* subroutines render whole pages
gitweb: Clean up code in git_search_* subroutines
gitweb: Split body of git_search into subroutines
gitweb: Check permissions first in git_search

Merge branch 'jl/submodule-add-relurl-wo-upstream'Junio C Hamano Fri, 22 Jul 2011 21:24:35 +0000 (14:24 -0700)

Merge branch 'jl/submodule-add-relurl-wo-upstream'

* jl/submodule-add-relurl-wo-upstream:
submodule add: clean up duplicated code
submodule add: allow relative repository path even when no url is set
submodule add: test failure when url is not configured in superproject

Conflicts:
git-submodule.sh

Merge branch 'maint'Junio C Hamano Fri, 22 Jul 2011 20:58:46 +0000 (13:58 -0700)

Merge branch 'maint'

* maint:
doc/fast-import: clarify notemodify command
Documentation: minor grammatical fix in rev-list-options.txt
Documentation: git-filter-branch honors replacement refs
remote-curl: Add a format check to parsing of info/refs
git-config: Remove extra whitespaces

doc/fast-import: clarify notemodify commandDmitry Ivankov Wed, 13 Jul 2011 17:10:53 +0000 (23:10 +0600)

doc/fast-import: clarify notemodify command

The "notemodify" fast-import command was introduced in commit a8dd2e7
(fast-import: Add support for importing commit notes, 2009-10-09)
The commit log has slightly different description than the added
documentation. The latter is somewhat confusing. "notemodify" is a
subcommand of "commit" command used to add a note for some commit.
Does this note annotate the commit produced by the "commit" command
or a commit given by it's committish parameter? Which notes tree
does it write notes to?

The exact meaning could be deduced with old description and some
notes machinery knowledge. But let's make it more obvious. This
command is used in a context like "commit refs/notes/test" to
add or rewrite an annotation for a committish parameter. So the
advised way to add notes in a fast-import stream is:
1) import some commits (optional)
2) prepare a "commit" to the notes tree:
2.1) choose notes ref, committer, log message, etc.
2.2) create annotations with "notemodify", where each can refer to
a commit being annotated via a branch name, import mark reference,
sha1 and other expressions specified in the Documentation.

Signed-off-by: Dmitry Ivankov <divanorama@gmail.com>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

reset: give better reflog messagesJeff King Fri, 22 Jul 2011 16:12:23 +0000 (10:12 -0600)

reset: give better reflog messages

The reset command creates its reflog entry from argv.
However, it does so after having run parse_options, which
means the only thing left in argv is any non-option
arguments. Thus you would end up with confusing reflog
entries like:

$ git reset --hard HEAD^
$ git reset --soft HEAD@{1}
$ git log -2 -g --oneline
8e46cad HEAD@{0}: HEAD@{1}: updating HEAD
1eb9486 HEAD@{1}: HEAD^: updating HEAD

However, we must also consider that some scripts may set
GIT_REFLOG_ACTION before calling reset, and we need to show
their reflog action (with our text appended). For example:

rebase -i (squash): updating HEAD

On top of that, we also set the ORIG_HEAD reflog action
(even though it doesn't generally exist). In that case, the
reset argument is somewhat meaningless, as it has nothing to
do with what's in ORIG_HEAD.

This patch changes the reset reflog code to show:

$GIT_REFLOG_ACTION: updating {HEAD,ORIG_HEAD}

as before, but only if GIT_REFLOG_ACTION is set. Otherwise,
show:

reset: moving to $rev

for HEAD, and:

reset: updating ORIG_HEAD

for ORIG_HEAD (this is still somewhat superfluous, since we
are in the ORIG_HEAD reflog, obviously, but at least we now
mention which command was used to update it).

While we're at it, we can clean up the code a bit:

- Use strbufs to make the message.

- Use the "rev" parameter instead of showing all options.
This makes more sense, since it is the only thing
impacting the writing of the ref.

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

Documentation: minor grammatical fix in rev-list-option... Jack Nagel Fri, 22 Jul 2011 01:33:15 +0000 (20:33 -0500)

Documentation: minor grammatical fix in rev-list-options.txt

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: git-filter-branch honors replacement... Peter Collingbourne Thu, 21 Jul 2011 15:10:52 +0000 (16:10 +0100)

Documentation: git-filter-branch honors replacement refs

Make it clear that git-filter-branch will honor and make permanent
replacement refs as well as grafts.

Signed-off-by: Peter Collingbourne <peter@pcc.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-curl: Add a format check to parsing of info... Julian Phillips Sat, 16 Jul 2011 18:23:51 +0000 (19:23 +0100)

remote-curl: Add a format check to parsing of info/refs

When parsing info/refs, no checks were applied that the file was in
the requried format. Since the file is read from a remote webserver,
this isn't guarenteed to be true. Add a check that the file at least
only contains lines that consist of 40 characters followed by a tab
and then the ref name.

Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: add Minix configuration options.Thomas Cort Tue, 19 Jul 2011 22:55:47 +0000 (18:55 -0400)

Makefile: add Minix configuration options.

Add a $(uname_S) case for Minix with the correct options.

Minix's linker needs all libraries specified explicitly.
Add NEEDS_SSL_WITH_CURL to add -lssl when using -lcurl.
Add NEEDS_IDN_WITH_CURL to add -lidn when using -lcurl.

When NEEDS_SSL_WITH_CURL is defined and NEEDS_CRYPTO_WITH_SSL
is defined, add -lcrypt to CURL_LIBCURL.

Change OPENSSL_LINK to OPENSSL_LIBSSL in the
NEEDS_CRYPTO_WITH_SSL conditional in the libopenssl
section. Libraries go in OPENSSL_LIBSSL, OPENSSL_LINK
is for linker flags.

Signed-off-by: Thomas Cort <tcort@minix3.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-config: Remove extra whitespacesPavan Kumar Sunkara Sat, 16 Jul 2011 21:55:52 +0000 (03:25 +0530)

git-config: Remove extra whitespaces

Remove extra whitespaces introduced by commits
01ebb9dc and fc1905bb

Signed-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: cleanup binary test vector filesVitaliy Ivanov Tue, 19 Jul 2011 17:21:47 +0000 (20:21 +0300)

tests: cleanup binary test vector files

The test4012.png test vector file that was originally used for t4012 to
check operations on binary files was later reused in other tests, making
it no longer consistent to name it after a specific test. Rename it to more
generic "test-binary-1.png".

While at it, rename test9200b to "test-binary-2.png" (even though it is
only used by t9200).

Signed-off-by: Vitaliy Ivanov <vitalivanov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

transport-helper: die early on encountering deleted... Sverre Rabbelier Sat, 16 Jul 2011 13:03:41 +0000 (15:03 +0200)

transport-helper: die early on encountering deleted refs

Remote helpers do not support deleting refs by means of the 'export'
command sincethe fast-import protocol does not support it.

Check explicitly for deleted refs and die early.

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

transport-helper: implement marks location as capabilitySverre Rabbelier Sat, 16 Jul 2011 13:03:40 +0000 (15:03 +0200)

transport-helper: implement marks location as capability

Now that the gitdir location is exported as an environment variable
this can be implemented elegantly without requiring any explicit
flushes nor an ad-hoc exchange of values.

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