git.git
14 years agoMerge 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

14 years agodoc/fast-import: clarify notemodify command
Dmitry 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 <redacted>
Acked-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agoreset: give better reflog messages
Jeff 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agoDocumentation: minor grammatical fix in rev-list-options.txt
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agoref namespaces: tests
Josh Triplett [Thu, 21 Jul 2011 20:10:54 +0000 (13:10 -0700)]
ref namespaces: tests

Test pushing, pulling, and mirroring of repositories with ref
namespaces.

Signed-off-by: Josh Triplett <redacted>
Signed-off-by: Jamey Sharp <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agoDocumentation: git-filter-branch honors replacement refs
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agoremote-curl: Add a format check to parsing of info/refs
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agohttp: retry authentication failures for all http requests
Jeff King [Mon, 18 Jul 2011 07:50:14 +0000 (03:50 -0400)]
http: retry authentication failures for all http requests

Commit 42653c0 (Prompt for a username when an HTTP request
401s, 2010-04-01) changed http_get_strbuf to prompt for
credentials when we receive a 401, but didn't touch
http_get_file. The latter is called only for dumb http;
while it's usually the case that people don't use
authentication on top of dumb http, there is no reason not
to allow both types of requests to use this feature.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agoremote-curl: don't retry auth failures with dumb protocol
Jeff King [Mon, 18 Jul 2011 07:49:56 +0000 (03:49 -0400)]
remote-curl: don't retry auth failures with dumb protocol

When fetching an http URL, we first try fetching info/refs
with an extra "service" parameter. This will work for a
smart-http server, or a dumb server which ignores extra
parameters when fetching files. If that fails, we retry
without the extra parameter to remain compatible with dumb
servers which didn't like our first request.

If the server returned a "401 Unauthorized", indicating that
the credentials we provided were not good, there is not much
point in retrying. With the current code, we just waste an
extra round trip to the HTTP server before failing.

But as the http code becomes smarter about throwing away
rejected credentials and re-prompting the user for new ones
(which it will later in this series), this will become more
confusing. At some point we will stop asking for credentials
to retry smart http, and will be asking for credentials to
retry dumb http. So now we're not only wasting an extra HTTP
round trip for something that is unlikely to work, but we're
making the user re-type their password for it.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agoimprove httpd auth tests
Jeff King [Mon, 18 Jul 2011 07:49:12 +0000 (03:49 -0400)]
improve httpd auth tests

These just checked that we could clone a repository when the
username and password were given in the URL; we should also
check that git will prompt when no or partial credentials
are given.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agourl: decode buffers that are not NUL-terminated
Jeff King [Mon, 18 Jul 2011 07:48:51 +0000 (03:48 -0400)]
url: decode buffers that are not NUL-terminated

The url_decode function needs only minor tweaks to handle
arbitrary buffers. Let's do those tweaks, which cleans up an
unreadable mess of temporary strings in http.c.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agoMakefile: 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agogit-config: Remove extra whitespaces
Pavan 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agotests: cleanup binary test vector files
Vitaliy 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agotransport-helper: die early on encountering deleted refs
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 <redacted>
Acked-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agotransport-helper: implement marks location as capability
Sverre 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 <redacted>
Acked-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agotransport-helper: Use capname for refspec capability too
Sverre Rabbelier [Sat, 16 Jul 2011 13:03:39 +0000 (15:03 +0200)]
transport-helper: Use capname for refspec capability too

Previously the refspec capability could not be listed as
required or their parsing would break.

Most likely the reason the second hunk wasn't caught is because the
series that added 'refspec' as capability, and the one that added
required capabilities were done in parallel.

Signed-off-by: Sverre Rabbelier <redacted>
Acked-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agotransport-helper: change import semantics
Sverre Rabbelier [Sat, 16 Jul 2011 13:03:38 +0000 (15:03 +0200)]
transport-helper: change import semantics

Currently the helper must somehow guess how many import statements to
read before it starts outputting its fast-export stream. This is
because the remote helper infrastructure runs fast-import only once,
so the helper is forced to output one stream for all import commands
it will receive. The only reason this worked in the past was because
only one ref was imported at a time.

Change the semantics of the import statement such that it matches
that of the push statement. That is, the import statement is followed
by a series of import statements that are terminated by a '\n'.

Signed-off-by: Sverre Rabbelier <redacted>
Acked-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agotransport-helper: update ref status after push with export
Sverre Rabbelier [Sat, 16 Jul 2011 13:03:37 +0000 (15:03 +0200)]
transport-helper: update ref status after push with export

Also add check_output from python 2.7.

Signed-off-by: Sverre Rabbelier <redacted>
Acked-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agotransport-helper: use the new done feature where possible
Sverre Rabbelier [Sat, 16 Jul 2011 13:03:36 +0000 (15:03 +0200)]
transport-helper: use the new done feature where possible

In other words, use fast-export --use-done-feature to add a 'done'
command at the end of streams passed to remote helpers' "import"
commands, and teach the remote helpers implementing "export" to use
the 'done' command in turn when producing their streams.

The trailing \n in the protocol signals the helper that the
connection is about to close, allowing it to do whatever cleanup
neccesary.

Previously, the connection would already be closed by the
time the trailing \n was to be written. Now that the remote-helper
protocol uses the new done command in its fast-import streams, this
is no longer the case and we can safely write the trailing \n.

Signed-off-by: Sverre Rabbelier <redacted>
Acked-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agofast-import: introduce 'done' command
Sverre Rabbelier [Sat, 16 Jul 2011 13:03:32 +0000 (15:03 +0200)]
fast-import: introduce 'done' command

Add a 'done' command that causes fast-import to stop reading from the
stream and exit.

If the new --done command line flag was passed on the command line
(or a "feature done" declaration included at the start of the stream),
make the 'done' command mandatory.  So "git fast-import --done"'s
input format will be prefix-free, making errors easier to detect when
they show up as early termination at some convenient time of the
upstream of a pipe writing to fast-import.

Another possible application of the 'done' command would to be allow a
fast-import stream that is only a small part of a larger encapsulating
stream to be easily parsed, leaving the file offset after the "done\n"
so the other application can pick up from there.  This patch does not
teach fast-import to do that --- fast-import still uses buffered input
(stdio).

Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Sverre Rabbelier <redacted>
Acked-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agotransport-helper: check status code of finish_command
Sverre Rabbelier [Sat, 16 Jul 2011 13:03:35 +0000 (15:03 +0200)]
transport-helper: check status code of finish_command

Previously the status code of all helpers were ignored, allowing
errors that occur to go unnoticed if the error text output by the
helper is not noticed.

Signed-off-by: Sverre Rabbelier <redacted>
Acked-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agogit-remote-testgit: fix error handling
Sverre Rabbelier [Sat, 16 Jul 2011 13:03:31 +0000 (15:03 +0200)]
git-remote-testgit: fix error handling

If fast-export did not complete successfully the error handling code
itself would error out.

This was broken in commit 23b093ee0 (Brandon Casey, Wed Jun 9 2010,
Remove python 2.5'isms). Revert that commit an introduce our own copy
of check_call in util.py instead.

Tested by changing 'if retcode' to 'if not retcode' temporarily.

Signed-off-by: Sverre Rabbelier <redacted>
Acked-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agotransport-helper: factor out push_update_refs_status
Sverre Rabbelier [Sat, 16 Jul 2011 13:03:34 +0000 (15:03 +0200)]
transport-helper: factor out push_update_refs_status

The update ref status part of push is useful for the export command
as well, factor it out into it's own function.

Also factor out push_update_ref_status to avoid a long loop without
an explicit condition with a non-trivial body.

Signed-off-by: Sverre Rabbelier <redacted>
Acked-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agogit-remote-testgit: only push for non-local repositories
Sverre Rabbelier [Sat, 16 Jul 2011 13:03:30 +0000 (15:03 +0200)]
git-remote-testgit: only push for non-local repositories

Trying to push for local repositories will fail since there is no
local checkout in .git/info/... to push from as that is only used for
non-local repositories (local repositories are pushed to directly).

This went unnoticed because the transport helper infrastructure does
not check the return value of the helper.

Signed-off-by: Sverre Rabbelier <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agofast-export: support done feature
Sverre Rabbelier [Sat, 16 Jul 2011 13:03:33 +0000 (15:03 +0200)]
fast-export: support done feature

If fast-export is being used to generate a fast-import stream that
will be used afterwards it is desirable to indicate the end of the
stream with the new 'done' command.

Add a flag that causes fast-export to end with 'done'.

Signed-off-by: Sverre Rabbelier <redacted>
Acked-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agoremote-curl: accept empty line as terminator
Sverre Rabbelier [Sat, 16 Jul 2011 13:03:29 +0000 (15:03 +0200)]
remote-curl: accept empty line as terminator

This went unnoticed because the transport helper infrastructore did
not check the return value of the helper, nor did the helper print
anything before exiting.

While at it also make sure that the stream doesn't end unexpectedly.

Signed-off-by: Sverre Rabbelier <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agoremote-helpers: export GIT_DIR variable to helpers
Dmitry Ivankov [Sat, 16 Jul 2011 13:03:28 +0000 (15:03 +0200)]
remote-helpers: export GIT_DIR variable to helpers

The gitdir capability is recognized by git and can be used to tell
the helper where the .git directory is. But it is not mentioned in
the documentation and considered worse than if gitdir was passed
via GIT_DIR environment variable.

Remove support for the gitdir capability and export GIT_DIR instead.
Teach testgit to use env instead of the now-removed gitdir command.

[sr: fixed up documentation]

Signed-off-by: Dmitry Ivankov <redacted>
Signed-off-by: Sverre Rabbelier <redacted>
Acked-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agogit_remote_helpers: push all refs during a non-local export
Jeff King [Sat, 16 Jul 2011 13:03:27 +0000 (15:03 +0200)]
git_remote_helpers: push all refs during a non-local export

When a remote helper exports to a non-local git repo, the
steps are roughly:

  1. fast-export into a local staging area; the set of
     interesting refs is defined by what is in the fast-export
     stream

  2. git push from the staging area to the non-local repo

In the second step, we should explicitly push all refs, not
just matching ones. This will let us push refs that do not
yet exist in the remote repo.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Sverre Rabbelier <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agotransport-helper: don't feed bogus refs to export push
Jeff King [Sat, 16 Jul 2011 13:03:26 +0000 (15:03 +0200)]
transport-helper: don't feed bogus refs to export push

When we want to push to a remote helper that has the
"export" capability, we collect all of the refs we want to
push and then feed them to fast-export.

However, the list of refs is actually a list of remote refs,
not local refs. The mapped local refs are included via the
peer_ref pointer. So when we add an argument to our
fast-export command line, we must be sure to use the local
peer_ref name (and if there is no local name, it is because
we are not actually sending that ref, or we may not even
have the ref at all).

Signed-off-by: Jeff King <redacted>
Signed-off-by: Sverre Rabbelier <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agogit-remote-testgit: import non-HEAD refs
Jeff King [Sat, 16 Jul 2011 13:03:25 +0000 (15:03 +0200)]
git-remote-testgit: import non-HEAD refs

Upon receiving an "import" command, the testgit remote
helper would ignore the ref asked for by git and generate a
fast-export stream based on HEAD. Instead, we should
actually give git the ref it asked for.

This requires adding a new parameter to the export_repo
method in the remote-helpers python library, which may be
used by code outside of git.git. We use a default parameter
so that callers without the new parameter will get the same
behavior as before.

Signed-off-by: Jeff King <redacted>
Signed-off-by: Sverre Rabbelier <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agot5800: document some non-functional parts of remote helpers
Jeff King [Sat, 16 Jul 2011 13:03:24 +0000 (15:03 +0200)]
t5800: document some non-functional parts of remote helpers

These are all things one might expect to work in a helper
that is capable of handling multiple branches (which our
testgit helper in theory should be able to do, as it is
backed by git). All of these bugs are specific to the
import/export codepaths, so they don't affect helpers like
git-remote-curl that use fetch/push commands.

The first and fourth tests are about fetching and pushing
new refs, and demonstrate bugs in the git_remote_helpers
library (so they would be most likely to impact helpers for
other VCSs which import/export git).

The second test is about importing multiple refs; it
demonstrates a bug in git-remote-testgit, which is mostly
for exercising the test code. Therefore it probably doesn't
affect anyone in practice.

The third test demonstrates a bug in git's side of the
helper code when the upstream has added refs that we do not
have locally. This could impact git users who use remote
helpers to access foreign VCSs.

All of those bugs have fixes later in this series.

The fifth test is the most complex, and does not have a fix
in this series. It tests pushing a ref via the export
mechanism to a new name on the remote side (i.e.,
"git push $remote old:new").

The problem is that we push all of the work of generating
the export stream onto fast-export, but we have no way of
communicating to fast-export that this name mapping is
happening. So we tell fast-export to generate a stream with
the commits for "old", but we can't tell it to label them
all as "new".

Signed-off-by: Jeff King <redacted>
Signed-off-by: Sverre Rabbelier <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agot5800: use skip_all instead of prereq
Sverre Rabbelier [Sat, 16 Jul 2011 13:03:23 +0000 (15:03 +0200)]
t5800: use skip_all instead of prereq

All tests require python 2.4 or higher.

Signed-off-by: Sverre Rabbelier <redacted>
Acked-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agot5800: factor out some ref tests
Jeff King [Sat, 16 Jul 2011 13:03:22 +0000 (15:03 +0200)]
t5800: factor out some ref tests

These are a little hard to read, and I'm about to add more
just like them. Plus the failure output is nicer if we use
test_cmp than a comparison with "test".

Signed-off-by: Jeff King <redacted>
Signed-off-by: Sverre Rabbelier <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agotransport-helper: fix minor leak in push_refs_with_export
Jeff King [Sat, 16 Jul 2011 13:03:21 +0000 (15:03 +0200)]
transport-helper: fix minor leak in push_refs_with_export

Signed-off-by: Sverre Rabbelier <redacted>
Acked-by: Jeff King <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agoUpdate draft release notes to 1.7.7
Junio C Hamano [Tue, 19 Jul 2011 17:44:51 +0000 (10:44 -0700)]
Update draft release notes to 1.7.7

The second batch of topics for this cycle are now in.

Signed-off-by: Junio C Hamano <redacted>
14 years agoMerge branch 'jc/index-pack'
Junio C Hamano [Tue, 19 Jul 2011 16:54:51 +0000 (09:54 -0700)]
Merge branch 'jc/index-pack'

* jc/index-pack:
  verify-pack: use index-pack --verify
  index-pack: show histogram when emulating "verify-pack -v"
  index-pack: start learning to emulate "verify-pack -v"
  index-pack: a miniscule refactor
  index-pack --verify: read anomalous offsets from v2 idx file
  write_idx_file: need_large_offset() helper function
  index-pack: --verify
  write_idx_file: introduce a struct to hold idx customization options
  index-pack: group the delta-base array entries also by type

Conflicts:
builtin/verify-pack.c
cache.h
sha1_file.c

14 years agoMerge branch 'jn/mime-type-with-params'
Junio C Hamano [Tue, 19 Jul 2011 16:45:41 +0000 (09:45 -0700)]
Merge branch 'jn/mime-type-with-params'

* jn/mime-type-with-params:
  gitweb: Serve */*+xml 'blob_plain' as text/plain with $prevent_xss
  gitweb: Serve text/* 'blob_plain' as text/plain with $prevent_xss

14 years agoMerge branch 'jc/submodule-sync-no-auto-vivify'
Junio C Hamano [Tue, 19 Jul 2011 16:45:37 +0000 (09:45 -0700)]
Merge branch 'jc/submodule-sync-no-auto-vivify'

* jc/submodule-sync-no-auto-vivify:
  submodule add: always initialize .git/config entry
  submodule sync: do not auto-vivify uninteresting submodule

Conflicts:
git-submodule.sh

14 years agoMerge branch 'jk/archive-tar-filter'
Junio C Hamano [Tue, 19 Jul 2011 16:45:32 +0000 (09:45 -0700)]
Merge branch 'jk/archive-tar-filter'

* jk/archive-tar-filter:
  upload-archive: allow user to turn off filters
  archive: provide builtin .tar.gz filter
  archive: implement configurable tar filters
  archive: refactor file extension format-guessing
  archive: move file extension format-guessing lower
  archive: pass archiver struct to write_archive callback
  archive: refactor list of archive formats
  archive-tar: don't reload default config options
  archive: reorder option parsing and config reading

14 years agoMerge branch 'jn/gitweb-split-header-html'
Junio C Hamano [Tue, 19 Jul 2011 16:45:28 +0000 (09:45 -0700)]
Merge branch 'jn/gitweb-split-header-html'

* jn/gitweb-split-header-html:
  gitweb: Refactor git_header_html

14 years agoMerge branch 'jk/clone-cmdline-config'
Junio C Hamano [Tue, 19 Jul 2011 16:45:24 +0000 (09:45 -0700)]
Merge branch 'jk/clone-cmdline-config'

* jk/clone-cmdline-config:
  clone: accept config options on the command line
  config: make git_config_parse_parameter a public function
  remote: use new OPT_STRING_LIST
  parse-options: add OPT_STRING_LIST helper

14 years agoMerge branch 'jk/maint-config-param'
Junio C Hamano [Tue, 19 Jul 2011 16:45:21 +0000 (09:45 -0700)]
Merge branch 'jk/maint-config-param'

* jk/maint-config-param:
  config: use strbuf_split_str instead of a temporary strbuf
  strbuf: allow strbuf_split to work on non-strbufs
  config: avoid segfault when parsing command-line config
  config: die on error in command-line config
  fix "git -c" parsing of values with equals signs
  strbuf_split: add a max parameter

14 years agoMerge branch 'jk/tag-list-multiple-patterns'
Junio C Hamano [Tue, 19 Jul 2011 16:45:15 +0000 (09:45 -0700)]
Merge branch 'jk/tag-list-multiple-patterns'

* jk/tag-list-multiple-patterns:
  tag: accept multiple patterns for --list

14 years agoMerge branch 'jc/zlib-wrap'
Junio C Hamano [Tue, 19 Jul 2011 16:33:03 +0000 (09:33 -0700)]
Merge branch 'jc/zlib-wrap'

* jc/zlib-wrap:
  zlib: allow feeding more than 4GB in one go
  zlib: zlib can only process 4GB at a time
  zlib: wrap deflateBound() too
  zlib: wrap deflate side of the API
  zlib: wrap inflateInit2 used to accept only for gzip format
  zlib: wrap remaining calls to direct inflate/inflateEnd
  zlib wrapper: refactor error message formatter

Conflicts:
sha1_file.c

14 years agoMerge branch 'ak/gcc46-profile-feedback'
Junio C Hamano [Tue, 19 Jul 2011 16:32:52 +0000 (09:32 -0700)]
Merge branch 'ak/gcc46-profile-feedback'

* ak/gcc46-profile-feedback:
  Add explanation of the profile feedback build to the README
  Add profile feedback build to git
  Add option to disable NORETURN

14 years agogit-gui: drop the 'n' and 'Shift-n' bindings from the last patch.
Pat Thoyts [Tue, 19 Jul 2011 14:33:34 +0000 (15:33 +0100)]
git-gui: drop the 'n' and 'Shift-n' bindings from the last patch.

The 'n' binding should cause the next match to be selected but results
in the search field gaining focus and additional 'n's being appended.

Signed-off-by: Pat Thoyts <redacted>
14 years agogit-gui: Add keyboard shortcuts for search and goto commands in blame view.
David Fries [Sat, 16 Jul 2011 16:59:45 +0000 (11:59 -0500)]
git-gui: Add keyboard shortcuts for search and goto commands in blame view.

Use forward-slash or Control-S to bring up the search dialog.
In the blame view, Enter or 'n' jump to the next selected region while
Shift-Enter or Shift-n will jump to the previous selected region.
Within the search control, hitting Enter will now jump to the next matching
region.

Signed-off-by: David Fries <redacted>
Signed-off-by: Pat Thoyts <redacted>
14 years agogit-gui: Enable jumping to a specific line number in blame view.
David Fries [Sun, 17 Jul 2011 01:47:14 +0000 (20:47 -0500)]
git-gui: Enable jumping to a specific line number in blame view.

This patch adds a goto control similar to the search control currently
available. The goto control permits the user to specify a line number to
jump to.
When in blame, Control-G is bound to display this control.

Signed-off-by: David Fries <redacted>
Signed-off-by: Pat Thoyts <redacted>
14 years agoRevert clock-skew based attempt to optimize tag --contains traversal
Junio C Hamano [Thu, 14 Jul 2011 18:02:06 +0000 (11:02 -0700)]
Revert clock-skew based attempt to optimize tag --contains traversal

Signed-off-by: Junio C Hamano <redacted>
14 years agoDo not log unless all connect() attempts fail
Dave Zarzycki [Tue, 12 Jul 2011 16:28:34 +0000 (09:28 -0700)]
Do not log unless all connect() attempts fail

IPv6 hosts are often unreachable on the primarily IPv4 Internet and
therefore we shouldn't print an error if there are still other hosts we
can try to connect() to. This helps "git fetch --quiet" stay quiet.

Signed-off-by: Dave Zarzycki <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agorebase: clarify "restore the original branch"
Martin von Zweigbergk [Thu, 14 Jul 2011 03:47:06 +0000 (23:47 -0400)]
rebase: clarify "restore the original branch"

The description for 'git rebase --abort' currently says:

    Restore the original branch and abort the rebase operation.

The "restore" can be misinterpreted to imply that the original branch
was somehow in a broken state during the rebase operation. It is also
not completely clear what "the original branch" is --- is it the
branch that was checked out before the rebase operation was called or
is the the branch that is being rebased (it is the latter)? Although
both issues are made clear in the DESCRIPTION section, let us also
make the entry in the OPTIONS secion more clear.

Also remove the term "rebasing process" from the usage text, since the
user already knows that the text is about "git rebase".

Signed-off-by: Martin von Zweigbergk <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agodiff-lib: refactor run_diff_index() and do_diff_cache()
Junio C Hamano [Thu, 14 Jul 2011 01:57:42 +0000 (18:57 -0700)]
diff-lib: refactor run_diff_index() and do_diff_cache()

The latter is meant to be an API for internal callers that want to inspect
the resulting diff-queue, while the former is an implementation of "git
diff-index" command. Extract the common logic into a single helper
function and make them thin wrappers around it.

Signed-off-by: Junio C Hamano <redacted>
14 years agodiff-lib: simplify do_diff_cache()
Junio C Hamano [Thu, 14 Jul 2011 01:42:32 +0000 (18:42 -0700)]
diff-lib: simplify do_diff_cache()

Since 34110cd (Make 'unpack_trees()' have a separate source and
destination index, 2008-03-06), we can run unpack_trees() without munging
the index at all, but do_diff_cache() tried ever so carefully to work
around the old behaviour of the function.

We can just tell unpack_trees() not to touch the original index and there
is no need to clean-up whatever the previous round has done.

Signed-off-by: Junio C Hamano <redacted>
14 years agoreset [<commit>] paths...: do not mishandle unmerged paths
Junio C Hamano [Thu, 14 Jul 2011 04:36:29 +0000 (21:36 -0700)]
reset [<commit>] paths...: do not mishandle unmerged paths

Because "diff --cached HEAD" showed an incorrect blob object name on the
LHS of the diff, we ended up updating the index entry with bogus value,
not what we read from the tree.

Noticed by John Nowak.

Signed-off-by: Junio C Hamano <redacted>
14 years agoMerge branch 'js/rebase-typo-branch-squelch-usage'
Junio C Hamano [Wed, 13 Jul 2011 21:31:38 +0000 (14:31 -0700)]
Merge branch 'js/rebase-typo-branch-squelch-usage'

* js/rebase-typo-branch-squelch-usage:
  rebase: do not print lots of usage hints after an obvious error message

14 years agoMerge branch 'jn/doc-dashdash'
Junio C Hamano [Wed, 13 Jul 2011 21:31:37 +0000 (14:31 -0700)]
Merge branch 'jn/doc-dashdash'

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

14 years agoMerge branch 'bc/submodule-foreach-stdin-fix-1.7.4'
Junio C Hamano [Wed, 13 Jul 2011 21:31:37 +0000 (14:31 -0700)]
Merge branch 'bc/submodule-foreach-stdin-fix-1.7.4'

* bc/submodule-foreach-stdin-fix-1.7.4:
  git-submodule.sh: preserve stdin for the command spawned by foreach
  t/t7407: demonstrate that the command called by 'submodule foreach' loses stdin

Conflicts:
git-submodule.sh

14 years agoMerge branch 'nk/ref-doc'
Junio C Hamano [Wed, 13 Jul 2011 21:31:37 +0000 (14:31 -0700)]
Merge branch 'nk/ref-doc'

* 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

14 years agoMerge branch 'fk/relink-upon-ldflags-update'
Junio C Hamano [Wed, 13 Jul 2011 21:31:37 +0000 (14:31 -0700)]
Merge branch 'fk/relink-upon-ldflags-update'

* fk/relink-upon-ldflags-update:
  Makefile: Track changes to LDFLAGS and relink when necessary

14 years agoMerge 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

14 years agoMerge branch 'jc/maint-cygwin-trust-executable-bit-default'
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

14 years agoMerge 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

14 years agoMerge 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

14 years agoMerge 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.

14 years agoMerge 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

14 years agoMerge 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

14 years agoMerge 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

14 years agoMerge 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

14 years agoMerge 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.

14 years agoxdiff/xprepare: use a smaller sample size for histogram diff
Tay Ray Chuan [Tue, 12 Jul 2011 06:10:27 +0000 (14:10 +0800)]
xdiff/xprepare: use a smaller sample size for histogram diff

For histogram diff, we can afford a smaller sample size and thus a
poorer estimate of the number of lines, as the hash table (rhash) won't
be filled up/grown. This is safe as the final count of lines (xdf.nrecs)
will be updated correctly anyway by xdl_prepare_ctx().

This gives us a small boost in performance.

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agoxdiff/xprepare: skip classification
Tay Ray Chuan [Tue, 12 Jul 2011 06:10:26 +0000 (14:10 +0800)]
xdiff/xprepare: skip classification

xdiff performs "classification" of records (xdl_classify_record()),
replacing hashes (xrecord_t.ha) with a unique identifier of the
record/line and building a hash table (xrecord_t.rhash) of records. This
is then used to "cleanup" records (xdl_cleanup_records()).

We don't need any of that in histogram diff, so we omit calls to these
functions. We also skip allocating memory to the hash table, rhash, as
it is no longer used.

This gives us a small boost in performance.

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agoteach --histogram to diff
Tay Ray Chuan [Tue, 12 Jul 2011 06:10:25 +0000 (14:10 +0800)]
teach --histogram to diff

Port JGit's HistogramDiff algorithm over to C. Rough numbers (TODO) show
that it is faster than its --patience cousin, as well as the default
Meyers algorithm.

The implementation has been reworked to use structs and pointers,
instead of bitmasks, thus doing away with JGit's 2^28 line limit.

We also use xdiff's default hash table implementation (xdl_hash_bits()
with XDL_HASHLONG()) for convenience.

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agoDocumentation: clearly specify what refs are honored by core.logAllRefUpdates
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agoget_pwd_cwd(): Do not trust st_dev/st_ino blindly
Johannes 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 <redacted>
Acked-by: Johannes Sixt <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agoref namespaces: documentation
Josh Triplett [Fri, 8 Jul 2011 23:14:10 +0000 (16:14 -0700)]
ref namespaces: documentation

Document the namespace mechanism in a new gitnamespaces(7) page.
Reference it from receive-pack and upload-pack.

Document the new --namespace option and GIT_NAMESPACE environment
variable in git(1), and reference gitnamespaces(7).

Add a sample Apache configuration to http-backend(1) to support
namespaced repositories, and reference gitnamespaces(7).

Signed-off-by: Josh Triplett <redacted>
Signed-off-by: Jamey Sharp <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agoref namespaces: Support remote repositories via upload-pack and receive-pack
Josh Triplett [Fri, 8 Jul 2011 23:13:32 +0000 (16:13 -0700)]
ref namespaces: Support remote repositories via upload-pack and receive-pack

Change upload-pack and receive-pack to use the namespace-prefixed refs
when working with the repository, and use the unprefixed refs when
talking to the client, maintaining the masquerade.  This allows
clone, pull, fetch, and push to work with a suitably configured
GIT_NAMESPACE.

receive-pack advertises refs outside the current namespace as .have refs
(as it currently does for refs in alternates), so that the client can
use them to minimize data transfer but will otherwise ignore them.

With appropriate configuration, this also allows http-backend to expose
namespaces as multiple repositories with different paths.  This only
requires setting GIT_NAMESPACE, which http-backend passes through to
upload-pack and receive-pack.

Signed-off-by: Josh Triplett <redacted>
Signed-off-by: Jamey Sharp <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agoFix tooltip display with multiple monitors on windows.
Pat Thoyts [Mon, 11 Jul 2011 12:55:38 +0000 (13:55 +0100)]
Fix tooltip display with multiple monitors on windows.

On Windows the position of a window may be negative on a monitor to the
left of the primary display. A plus sign is used as the separator between
the width and height and the positional parts of the geometry so always
include the plus sign even for negative positions on this platform.

Signed-off-by: Pat Thoyts <redacted>
14 years agoFix typo: existant->existent
Dmitry Ivankov [Thu, 16 Jun 2011 12:22:39 +0000 (18:22 +0600)]
Fix typo: existant->existent

This typo was discovered in core git sources.
Clean in it up in git-gui too.
There is just one occurence in a comment line.

Signed-off-by: Dmitry Ivankov <redacted>
Signed-off-by: Pat Thoyts <redacted>
14 years agogit-gui: updated translator README for current procedures.
Pat Thoyts [Thu, 31 Mar 2011 15:24:36 +0000 (16:24 +0100)]
git-gui: updated translator README for current procedures.

We do not have a mob branch and the i18n fork is no longer used. Suggest
translators simply send patches as per other contributors.

Reported-by: Rodrigo Rosenfeld <redacted>
Signed-off-by: Pat Thoyts <redacted>
14 years agopack-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 <redacted>
14 years agohelp_unknown_cmd: do not propose an "unknown" cmd
Michael 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 <redacted>
Signed-off-by: Michael Schubert <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agot4033-diff-patience: factor out tests
Tay Ray Chuan [Thu, 7 Jul 2011 04:23:58 +0000 (12:23 +0800)]
t4033-diff-patience: factor out tests

Group the test cases into two functions, test_diff_(frobnitz|unique).
This in preparation for the histogram diff algorithm, which would also
re-use these test cases.

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agoxdiff/xpatience: factor out fall-back-diff function
Tay Ray Chuan [Thu, 7 Jul 2011 04:23:57 +0000 (12:23 +0800)]
xdiff/xpatience: factor out fall-back-diff function

This is in preparation for the histogram diff algorithm, which will also
re-use much of the code to call the default Meyers diff algorithm.

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agoxdiff/xprepare: refactor abort cleanups
Tay Ray Chuan [Thu, 7 Jul 2011 04:23:56 +0000 (12:23 +0800)]
xdiff/xprepare: refactor abort cleanups

Group free()'s that are called when a malloc() fails in
xdl_prepare_ctx(), making for more readable code.

Also add a free() on ha, in case future git hackers add allocs after the
ha malloc.

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agoxdiff/xprepare: use memset()
Tay Ray Chuan [Thu, 7 Jul 2011 04:23:55 +0000 (12:23 +0800)]
xdiff/xprepare: use memset()

Use memset() instead of a for loop to initialize. This could give a
performance advantage.

Signed-off-by: Tay Ray Chuan <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agocore: log offset pack data accesses happened
Junio 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 <redacted>
14 years agoStart 1.7.7 cycle
Junio C Hamano [Thu, 7 Jul 2011 00:00:46 +0000 (17:00 -0700)]
Start 1.7.7 cycle

Signed-off-by: Junio C Hamano <redacted>
14 years agoMerge 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

14 years agoMerge commit 'v1.7.6' into jc/checkout-reflog-fix
Junio 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
  ...

14 years agoMerge commit 'v1.7.0' into jc/checkout-reflog-fix
Junio 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
  ...

14 years agoMerge commit 'v1.6.0' into jc/checkout-reflog-fix
Junio 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

14 years agocheckout: do not write bogus reflog entry out
Junio 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 <redacted>
14 years agoDocumentation: use [verse] for SYNOPSIS sections
Martin 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agoref namespaces: infrastructure
Josh Triplett [Tue, 5 Jul 2011 17:54:44 +0000 (10:54 -0700)]
ref namespaces: infrastructure

Add support for dividing the refs of a single repository into multiple
namespaces, each of which can have its own branches, tags, and HEAD.
Git can expose each namespace as an independent repository to pull from
and push to, while sharing the object store, and exposing all the refs
to operations such as git-gc.

Storing multiple repositories as namespaces of a single repository
avoids storing duplicate copies of the same objects, such as when
storing multiple branches of the same source.  The alternates mechanism
provides similar support for avoiding duplicates, but alternates do not
prevent duplication between new objects added to the repositories
without ongoing maintenance, while namespaces do.

To specify a namespace, set the GIT_NAMESPACE environment variable to
the namespace.  For each ref namespace, git stores the corresponding
refs in a directory under refs/namespaces/.  For example,
GIT_NAMESPACE=foo will store refs under refs/namespaces/foo/.  You can
also specify namespaces via the --namespace option to git.

Note that namespaces which include a / will expand to a hierarchy of
namespaces; for example, GIT_NAMESPACE=foo/bar will store refs under
refs/namespaces/foo/refs/namespaces/bar/.  This makes paths in
GIT_NAMESPACE behave hierarchically, so that cloning with
GIT_NAMESPACE=foo/bar produces the same result as cloning with
GIT_NAMESPACE=foo and cloning from that repo with GIT_NAMESPACE=bar.  It
also avoids ambiguity with strange namespace paths such as
foo/refs/heads/, which could otherwise generate directory/file conflicts
within the refs directory.

Add the infrastructure for ref namespaces: handle the GIT_NAMESPACE
environment variable and --namespace option, and support iterating over
refs in a namespace.

Signed-off-by: Josh Triplett <redacted>
Signed-off-by: Jamey Sharp <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agoFix prefix handling in ref iteration functions
Josh Triplett [Tue, 5 Jul 2011 17:54:21 +0000 (10:54 -0700)]
Fix prefix handling in ref iteration functions

The do_for_each_ref iteration function accepts a prefix and a trim, and
checks for the prefix on each ref before passing in that ref; it also
supports trimming off part of the ref before passing it.  However,
do_for_each_ref used trim as the length of the prefix to check, ignoring
the actual length of the prefix.  Switch to using prefixcmp, checking
the entire length of the prefix string, to properly support a trim value
different than the length of the prefix.

Several callers passed a prefix of "refs/" to filter out everything
outside of refs/, but a trim of 0 to avoid trimming off the "refs/"; the
trim of 0 meant that the filter of "refs/" no longer applied.  Change
these callers to pass an empty prefix instead, to avoid changing the
existing behavior.  Various callers count on this lack of filtering,
such as receive-pack which uses add_extra_ref to add alternates as refs
named ".have"; adding filtering would break that, causing
t5501-fetch-push-alternates.sh to fail.  That lack of filtering doesn't
currently have any other effect, since the loose ref functions can never
supply refs outside of "refs/", and packed-refs will not normally
include such refs unless manually edited.

Signed-off-by: Josh Triplett <redacted>
Signed-off-by: Jamey Sharp <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agodocs: document --textconv diff option
Jeff 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agomergetool: check return value from read
Junio 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 <redacted>
14 years agobranch -v: honor core.abbrev
Namhyung Kim [Fri, 1 Jul 2011 06:06:08 +0000 (15:06 +0900)]
branch -v: honor core.abbrev

Use the value from 'core.abbrev' configuration variable unless user
specifies the length on command line when showing commit object name
in "branch -v" output.

Signed-off-by: Namhyung Kim <redacted>
Signed-off-by: Junio C Hamano <redacted>
14 years agogit skew: a tool to find how big a clock skew exists in the history
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 <redacted>
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
Signed-off-by: Junio C Hamano <redacted>
git clone https://git.99rst.org/PROJECT