gitweb.git
Retire git-runstatus for real.Junio C Hamano Sat, 15 Dec 2007 06:08:25 +0000 (22:08 -0800)

Retire git-runstatus for real.

The command was removed from the builtin command list and there was no
way to invoke it, but the code was still there.

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

Rename git-browse-help helper to git-browse--helpJunio C Hamano Sat, 15 Dec 2007 06:02:57 +0000 (22:02 -0800)

Rename git-browse-help helper to git-browse--help

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

git-help: add "help.format" config variable.Christian Couder Sat, 15 Dec 2007 04:57:28 +0000 (05:57 +0100)

git-help: add "help.format" config variable.

This config variable makes it possible to choose the default format
used to display help. This format will be used only if no option
like -a|--all|-i|--info|-m|--man|-w|--web is passed to "git-help".

The following values are possible for this variable:

- "man" --> "man" program is used
- "info" --> "info" program is used
- "web" --> "git-browse-help" is used

By default we still show help using "man".

This patch also adds -m|--man command line option to use "man"
to allow overriding the "help.format" configuration variable.

Note that this patch also revert some recent changes in
"git-browse-help" because they prevented to look for config
variables in the global configuration file.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'wc/diff'Junio C Hamano Sat, 15 Dec 2007 05:42:53 +0000 (21:42 -0800)

Merge branch 'wc/diff'

* wc/diff:
Test interaction between diff --check and --exit-code
Use shorter error messages for whitespace problems
Add tests for "git diff --check" with core.whitespace options
Make "diff --check" output match "git apply"
Unify whitespace checking
diff --check: minor fixups
"diff --check" should affect exit status

Move fetch_ref from http-push.c and http-walker.c to... Mike Hommey Mon, 10 Dec 2007 23:08:25 +0000 (00:08 +0100)

Move fetch_ref from http-push.c and http-walker.c to http.c

Make the necessary changes to be ok with their difference, and rename the
function http_fetch_ref.

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix various memory leaks in http-push.c and http-walker.cMike Hommey Mon, 10 Dec 2007 21:36:11 +0000 (22:36 +0100)

Fix various memory leaks in http-push.c and http-walker.c

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Use strbuf in http codeMike Hommey Sun, 9 Dec 2007 19:30:59 +0000 (20:30 +0100)

Use strbuf in http code

Also, replace whitespaces with tabs in some places

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Avoid redundant declaration of missing_target()Mike Hommey Mon, 10 Dec 2007 21:36:09 +0000 (22:36 +0100)

Avoid redundant declaration of missing_target()

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Remove a CURLOPT_HTTPHEADER (un)settingMike Hommey Mon, 10 Dec 2007 21:36:08 +0000 (22:36 +0100)

Remove a CURLOPT_HTTPHEADER (un)setting

Setting CURLOPT_HTTPHEADER doesn't add HTTP headers, but replaces whatever
set of headers was configured before, so setting to NULL doesn't have any
magic meaning, and is pretty much useless when setting to another list
right after.

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Remove the default_headers variable from http-push.cMike Hommey Mon, 10 Dec 2007 21:36:07 +0000 (22:36 +0100)

Remove the default_headers variable from http-push.c

It appears that despite being initialized, it was never used.

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix random sha1 in error message in http-fetch and... Mike Hommey Fri, 14 Dec 2007 21:18:01 +0000 (22:18 +0100)

Fix random sha1 in error message in http-fetch and http-push

When a downloaded ref doesn't contain a sha1, the error message displays
a random sha1 because of uninitialized memory. This happens when cloning
a repository that is already a clone of another one, in which case
refs/remotes/origin/HEAD is a symref.

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix some more memory leaks in http-push.cMike Hommey Fri, 14 Dec 2007 21:18:00 +0000 (22:18 +0100)

Fix some more memory leaks in http-push.c

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Test interaction between diff --check and --exit-codeWincent Colaiuta Fri, 14 Dec 2007 11:23:44 +0000 (12:23 +0100)

Test interaction between diff --check and --exit-code

Make sure that it works as advertised in the man page.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Use shorter error messages for whitespace problemsWincent Colaiuta Fri, 14 Dec 2007 11:23:43 +0000 (12:23 +0100)

Use shorter error messages for whitespace problems

The initial version of the whitespace_error_string() function took the
messages from builtin-apply.c rather than the shorter messages from
diff.c.

This commit addresses Junio's concern that these messages might be too
long (now that we can emit multiple warnings per line).

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Use a strbuf for building up section header and key... Kristian Høgsberg Fri, 14 Dec 2007 20:59:58 +0000 (15:59 -0500)

Use a strbuf for building up section header and key/value pair strings.

Avoids horrible 1-byte write(2) calls and cleans up the logic a bit.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import: fix unalinged allocation and accessDavid S. Miller Sat, 15 Dec 2007 04:39:16 +0000 (20:39 -0800)

fast-import: fix unalinged allocation and access

The specialized pool allocator fast-import uses aligned objects on the
size of a pointer, which was not sufficient at least on Sparc. Instead,
make the alignment for objects of type unitmax_t.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote: Fix bogus make_branch() call in configuration... Junio C Hamano Sat, 15 Dec 2007 04:34:56 +0000 (20:34 -0800)

remote: Fix bogus make_branch() call in configuration reader.

The configuration reader to enumerate branches that have configuration
data were not careful enough and failed to skip "branch.<variable>"
entries (e.g. branch.autosetupmerge). This resulted in bogus attempt to
allocate huge memory.

Noticed by David Miller.

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

commit: allow --amend to reuse message from another... Junio C Hamano Fri, 14 Dec 2007 19:57:22 +0000 (11:57 -0800)

commit: allow --amend to reuse message from another commit

After tentatively applying a patch from a contributor, you can get a
replacement patch with corrected code and unusable commit log message.
In such a case, this sequence ought to give you an editor based on the
message in the earlier commit, to let you describe an incremental
improvement:

git reset --hard HEAD^ ;# discard the earlier one
git am <corrected-patch
git commit --amend -c HEAD@{1}

Unfortunately, --amend insisted reusing the message from the commit
being amended, ignoring the -c option. This corrects it.

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

git-svn: handle our top-level path being deleted and... Eric Wong Fri, 14 Dec 2007 16:39:09 +0000 (08:39 -0800)

git-svn: handle our top-level path being deleted and later re-added

Previously, git-svn would ignore cases where the path we're
tracking is removed from the repository. This was to prevent
heads with follow-parent from ending up with a tree full of
empty revisions (and thus breaking rename detection).

The previous behavior is fine until the path we're tracking
is re-added later on, leading to the old files being merged
in with the new files in the directory (because the old
files were never marked as deleted)

We will now only remove all the old files locally that were
deleted remotely iff we detect the directory we're in is being
created from scratch.

Thanks for Marcus D. Hanwell for the bug report and
Peter Baumann for the analysis.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cvsexportcommit: fix massive commitsJeff King Fri, 14 Dec 2007 09:15:47 +0000 (04:15 -0500)

cvsexportcommit: fix massive commits

Because we feed the changed filenames to CVS on the command
line, it was possible for massive commits to overflow the
system exec limits. Instead, we now do an xargs-like split
of the arguments.

This means that we lose some of the atomicity of calling CVS
in one shot. Since CVS commits are not atomic, but the CVS
protocol is, the possible effects of this are not clear;
however, since CVS doesn't provide a different interface,
this is our only option for large commits (short of writing
a CVS client library).

The argument size limit is arbitrarily set to 64kB. This
should be high enough to trigger only in rare cases where it
is necessary, so normal-sized commits are not affected by
the atomicity change.

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

Documentation: describe pack idx v2linux@horizon.com Fri, 14 Dec 2007 11:28:14 +0000 (06:28 -0500)

Documentation: describe pack idx v2

Lifted from the log message of c553ca25bd60dc9fd50b8bc7bd329601b81cee66
(pack-objects: learn about pack index version 2).

Acked-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

xdiff tail trimming: use correct type.Junio C Hamano Fri, 14 Dec 2007 20:00:42 +0000 (12:00 -0800)

xdiff tail trimming: use correct type.

Inside xdiff library, the number of context lines is represented in
long, not int.

Noticed by Peter Baumann.

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

Add tests for "git diff --check" with core.whitespace... Wincent Colaiuta Thu, 13 Dec 2007 13:32:31 +0000 (14:32 +0100)

Add tests for "git diff --check" with core.whitespace options

Make sure that "git diff --check" does the right thing when the
core.whitespace options are set.

While we are at it, correct many uses of test_expect_failure that
ran sequence of commands.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Make "diff --check" output match "git apply"Wincent Colaiuta Thu, 13 Dec 2007 13:32:30 +0000 (14:32 +0100)

Make "diff --check" output match "git apply"

For consistency, make the two tools report whitespace errors in the
same way (the output of "diff --check" has been tweaked to match
that of "git apply").

Note that although the textual content is basically the same only
"git diff --check" provides a colorized version of the problematic
lines; making "git apply" do colorization will require more extensive
changes (figuring out the diff colorization preferences of the user)
and so that will be a subject for another commit.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Unify whitespace checkingWincent Colaiuta Thu, 13 Dec 2007 13:32:29 +0000 (14:32 +0100)

Unify whitespace checking

This commit unifies three separate places where whitespace checking was
performed:

- the whitespace checking previously done in builtin-apply.c is
extracted into a function in ws.c

- the equivalent logic in "git diff" is removed

- the emit_line_with_ws() function is also removed because that also
rechecks the whitespace, and its functionality is rolled into ws.c

The new function is called check_and_emit_line() and it does two things:
checks a line for whitespace errors and optionally emits it. The checking
is based on lines of content rather than patch lines (in other words, the
caller must strip the leading "+" or "-"); this was suggested by Junio on
the mailing list to allow for a future extension to "git show" to display
whitespace errors in blobs.

At the same time we teach it to report all classes of whitespace errors
found for a given line rather than reporting only the first found error.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff --check: minor fixupsJunio C Hamano Fri, 14 Dec 2007 07:40:27 +0000 (23:40 -0800)

diff --check: minor fixups

There is no reason --exit-code and --check-diff must be mutually
exclusive, so assign different bits to different results and allow them
to be returned from the command. Introduce diff_result_code() to factor
out the common code to decide final status code based on diffopt
settings and use it everywhere.

Update tests to match the above fix.

Turning pager off when "diff --check" is used is a regression.

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

"diff --check" should affect exit statusWincent Colaiuta Thu, 13 Dec 2007 20:24:52 +0000 (21:24 +0100)

"diff --check" should affect exit status

"git diff" has a --check option that can be used to check for whitespace
problems but it only reported by printing warnings to the
console.

Now when the --check option is used we give a non-zero exit status,
making "git diff --check" nicer to use in scripts and hooks.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

xdi_diff: trim common trailing linesJunio C Hamano Thu, 13 Dec 2007 22:24:18 +0000 (14:24 -0800)

xdi_diff: trim common trailing lines

This implements earlier Linus's optimization to trim common lines at the
end before passing them down to low level xdiff interface for all of our
xdiff users.

We could later enhance this to also trim common leading lines, but that
would need tweaking the output function to add the number of lines
trimmed at the beginning to line numbers that appear in the hunk
headers.

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

xdl_diff: identify call sites.Junio C Hamano Thu, 13 Dec 2007 21:25:07 +0000 (13:25 -0800)

xdl_diff: identify call sites.

This inserts a new function xdi_diff() that currently does not
do anything other than calling the underlying xdl_diff() to the
callchain of current callers of xdl_diff() function.

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

provide advance warning of some future pack default... Nicolas Pitre Fri, 14 Dec 2007 03:32:36 +0000 (22:32 -0500)

provide advance warning of some future pack default changes

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-svn: unlink internal index files after operationsEric Wong Thu, 13 Dec 2007 16:27:34 +0000 (08:27 -0800)

git-svn: unlink internal index files after operations

Being git, we can generate these very quickly on the fly as
needed, so there's no point in wasting space for these things
for large projects.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-svn: expand handling of From: and Signed-off-by:Andy Whitcroft Thu, 13 Dec 2007 06:58:15 +0000 (06:58 +0000)

git-svn: expand handling of From: and Signed-off-by:

The current parsing for From: and Signed-off-by: lines handles fully
specified names:

From: Full Name <email@address>

Expand this to include the raw email addresses and straight "names":

From: email@address -> email <email@address>
From: Full Name -> Full Name <unknown>

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix spelling mistakes in user manualShawn Bohrer Thu, 13 Dec 2007 04:36:21 +0000 (22:36 -0600)

Fix spelling mistakes in user manual

Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
Acked-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-commit: squelch needless message during an empty... Junio C Hamano Thu, 13 Dec 2007 03:09:16 +0000 (19:09 -0800)

git-commit: squelch needless message during an empty merge

When recording a merge that conflicted and ends up in no changes after
manual resolution, commit callchain looked like this:

cmd_commit() ->
prepare_log_message() ->
run_status() ->
wt_status_print()

This invocation of run_status() is asked to find out if there is a
committable change, but it unconditionally gave instructions such as
"use git-add" at the same time. When in merge, we do allow an empty
change to be recorded, so after showing this message the code still went
ahead and made a commit.

This introduces "nowarn" parameter to run_status() to avoid these
useless messages. If we are not allowed to create an empty commit, we
already call run_status() again in the original codepath, and the
message will be shown from that call anyway.

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

GIT 1.5.4-rc0 v1.5.4-rc0Junio C Hamano Thu, 13 Dec 2007 01:48:21 +0000 (17:48 -0800)

GIT 1.5.4-rc0

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

Merge branch 'cc/help'Junio C Hamano Thu, 13 Dec 2007 01:46:16 +0000 (17:46 -0800)

Merge branch 'cc/help'

* cc/help:
RPM spec: Adjust htmldir
git-help -w: do not require to be in git repository
git.spec.in: remove python_path
Documentation: rename git.texi to user-manual.texi
Add git-browse-help to .gitignore
git-help -i: show info documentation from matching version of git
git-help -i: invoke info with document and node name
Documentation: add gitman.info target
Documentation: describe -w/--web option to "git-help".
Use {web,instaweb,help}.browser config options.
git-help: add -w|--web option to display html man page in a browser.
Documentation: describe -i/--info option to "git-help"
git-help: add -i|--info option to display info page.

RPM spec: Adjust htmldirJunio C Hamano Wed, 12 Dec 2007 22:00:24 +0000 (14:00 -0800)

RPM spec: Adjust htmldir

git help -w needs to know the right location of installed pages.

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

git-help -w: do not require to be in git repositoryJunio C Hamano Thu, 13 Dec 2007 01:34:30 +0000 (17:34 -0800)

git-help -w: do not require to be in git repository

The users used to be able to say "git help cat-file" from anywhere, but
the browse-help script insisted to be in a git repository, which caused
"git help -w cat-file" to barf outside. Correct it.

While at it, remove leftover debugging "echo".

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

Merge branch 'jc/shortlog-e'Junio C Hamano Thu, 13 Dec 2007 01:07:03 +0000 (17:07 -0800)

Merge branch 'jc/shortlog-e'

* jc/shortlog-e:
shortlog: default to HEAD when the standard input is a tty
Invert numbers and names in the git-shortlog summary mode.
shortlog: document -e option
git-shortlog -e: show e-mail address as well

Merge branch 'ew/svn-rev-db'Junio C Hamano Thu, 13 Dec 2007 00:53:06 +0000 (16:53 -0800)

Merge branch 'ew/svn-rev-db'

* ew/svn-rev-db:
git-svn: reinstate old rev_db optimization in new rev_map
git-svn: replace .rev_db with a more space-efficient .rev_map format

Merge branch 'jc/merge-recursive-gitlink'Junio C Hamano Thu, 13 Dec 2007 00:52:59 +0000 (16:52 -0800)

Merge branch 'jc/merge-recursive-gitlink'

* jc/merge-recursive-gitlink:
Support a merge with conflicting gitlink change

Merge branch 'jk/svn-color'Junio C Hamano Thu, 13 Dec 2007 00:52:51 +0000 (16:52 -0800)

Merge branch 'jk/svn-color'

* jk/svn-color:
git-svn: get color config from --get-colorbool
Support GIT_PAGER_IN_USE environment variable

git.spec.in: remove python_pathJunio C Hamano Wed, 12 Dec 2007 21:42:12 +0000 (13:42 -0800)

git.spec.in: remove python_path

We do not depend on python nor customize scripts for it anymore.

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

Documentation: rename git.texi to user-manual.texiJunio C Hamano Wed, 12 Dec 2007 21:31:02 +0000 (13:31 -0800)

Documentation: rename git.texi to user-manual.texi

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

disable t9119 for now.Junio C Hamano Wed, 12 Dec 2007 19:53:29 +0000 (11:53 -0800)

disable t9119 for now.

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

Fix "diff --check" whitespace detectionWincent Colaiuta Wed, 12 Dec 2007 16:22:59 +0000 (17:22 +0100)

Fix "diff --check" whitespace detection

"diff --check" would only detect spaces before tabs if a tab was the
last character in the leading indent. Fix that and add a test case to
make sure the bug doesn't regress in the future.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-diff --numstat -z: make it machine readableJunio C Hamano Wed, 12 Dec 2007 07:46:30 +0000 (23:46 -0800)

git-diff --numstat -z: make it machine readable

The "-z" format is all about machine parsability, but showing renamed
paths as "common/{a => b}/suffix" makes it impossible. The scripts would
never have successfully parsed "--numstat -z -M" in the old format.

This fixes the output format in a (hopefully minimally) backward
incompatible way.

* The output without -z is not changed. This has given a good way for
humans to view added and deleted lines separately, and showing the
path in combined, shorter way would preserve readability.

* The output with -z is unchanged for paths that do not involve renames.
Existing scripts that do not pass -M/-C are not affected at all.

* The output with -z for a renamed path is shown in a format that can
easily be distinguished from an unrenamed path.

This is based on Jakub Narebski's patch. Bugs and documentation typos
are mine.

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

Documentation: minor grammar fix for "git apply"Wincent Colaiuta Wed, 12 Dec 2007 08:14:20 +0000 (09:14 +0100)

Documentation: minor grammar fix for "git apply"

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Use "whitespace" consistentlyWincent Colaiuta Wed, 12 Dec 2007 08:12:01 +0000 (09:12 +0100)

Use "whitespace" consistently

For consistency, change "white space" and "whitespaces" to
"whitespace", fixing a couple of adjacent grammar problems in the
docs.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix XML parser leaks in http-pushMike Hommey Tue, 11 Dec 2007 22:50:21 +0000 (23:50 +0100)

Fix XML parser leaks in http-push

XML_Parser were never freed. While at it, move the parser initialization to
right before it is needed.

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix small memory leaks induced by diff_tree_setup_pathsMike Hommey Tue, 11 Dec 2007 21:59:55 +0000 (22:59 +0100)

Fix small memory leaks induced by diff_tree_setup_paths

Run diff_tree_release_paths in the appropriate places, and add a test to
avoid NULL dereference. Better safe than sorry.

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix git-fast-export for zero-sized blobsAlex Riesen Tue, 11 Dec 2007 22:01:28 +0000 (23:01 +0100)

Fix git-fast-export for zero-sized blobs

Writing 1 elements of size 0-byte successfully will cause fwrite(3) to
return 0, and flagging it as error is a mistake.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix clone not to ignore depth when performing a local... Charles Bailey Tue, 11 Dec 2007 06:47:31 +0000 (06:47 +0000)

Fix clone not to ignore depth when performing a local clone

When git-clone detects that it can perform a local clone it
follows a path that silently ignores the depth parameter.

Presumably if the user explicitly requests a shallow clone they
have a reason to prefer a space efficient clone of just the recent
history so bypass the local magic if the user specifies the depth
parameter.

Signed-off-by: Charles Bailey <charles@hashpling.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

shortlog: default to HEAD when the standard input is... Junio C Hamano Tue, 11 Dec 2007 18:09:04 +0000 (10:09 -0800)

shortlog: default to HEAD when the standard input is a tty

Instead of warning the user that it is expecting git log output from
the standard input (and waiting for the user to type the log from
the keyboard, which is a silly thing to do), default to traverse from
HEAD when there is no rev parameter given and the standard input is
a tty.

This factors out a useful helper "add_head()" from builtin-diff.c to a
more appropriate place revision.c while renaming it to more descriptive
name add_head_to_pending(), as that is what the function is about.

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

blame: drop blob data after passing blame to the parentJunio C Hamano Wed, 12 Dec 2007 00:05:50 +0000 (16:05 -0800)

blame: drop blob data after passing blame to the parent

We used to keep the blob data for each origin that has any remaining
line in the result, but this will get very costly with a huge file that
has a deep history. This patch releases the blob after we ran diff
between the child rev and its parents. When passing blame from a parent
to its parent (i.e. the grandparent), the blob data for the parent may
need to be read again, but it should be relatively cheap, thanks to
delta-base cache.

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

git-clone: print an error message when trying to clone... Jeff King Tue, 11 Dec 2007 12:53:47 +0000 (07:53 -0500)

git-clone: print an error message when trying to clone empty repo

Previously, cloning an empty repository looked like this:

$ (mkdir parent && cd parent && git --bare init)
$ git-clone parent child
Initialized empty Git repository in /home/peff/clone/child/.git/
$ cd child
-bash: cd: child: No such file or directory
$ echo 'wtf?' | mail git@vger.kernel.org

Now we at least report that the clone was not successful.

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

Invert numbers and names in the git-shortlog summary... Pierre Habouzit Tue, 11 Dec 2007 14:43:51 +0000 (15:43 +0100)

Invert numbers and names in the git-shortlog summary mode.

Also make it `cut` friendly using a tab to separate the numbers and names.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

shortlog: document -e optionJeff King Tue, 11 Dec 2007 12:33:12 +0000 (07:33 -0500)

shortlog: document -e option

This shows e-mail address in addition to author's name.

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

git.el: Added a menu for git-status-mode.Alexandre Julliard Tue, 11 Dec 2007 12:56:09 +0000 (13:56 +0100)

git.el: Added a menu for git-status-mode.

Originally written by Rémi Vanicat, I just changed the layout a little.

Signed-off-by: Rémi Vanicat <vanicat@debian.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix a typo in checkout.sh and cleanup one-line help... Johannes Sixt Tue, 11 Dec 2007 16:36:32 +0000 (17:36 +0100)

Fix a typo in checkout.sh and cleanup one-line help messages

This also shortens option descriptions to fit in 80 columns.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-svn: get color config from --get-colorboolJeff King Tue, 11 Dec 2007 06:28:42 +0000 (01:28 -0500)

git-svn: get color config from --get-colorbool

git-config recently learned a --get-colorbool option. By
using it, we will get the same color=auto behavior that
other git commands have.

Specifically, this fixes the case where "color.diff = true"
meant "always" in git-svn, but "auto" in other programs.

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

Support GIT_PAGER_IN_USE environment variableJeff King Tue, 11 Dec 2007 06:27:33 +0000 (01:27 -0500)

Support GIT_PAGER_IN_USE environment variable

When deciding whether or not to turn on automatic color
support, git_config_colorbool checks whether stdout is a
tty. However, because we run a pager, if stdout is not a
tty, we must check whether it is because we started the
pager. This used to be done by checking the pager_in_use
variable.

This variable was set only when the git program being run
started the pager; there was no way for an external program
running git indicate that it had already started a pager.
This patch allows a program to set GIT_PAGER_IN_USE to a
true value to indicate that even though stdout is not a tty,
it is because a pager is being used.

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

Support a merge with conflicting gitlink changeJunio C Hamano Mon, 10 Dec 2007 19:22:05 +0000 (11:22 -0800)

Support a merge with conflicting gitlink change

merge-recursive did not support merging trees that have conflicting
changes in submodules they contain, and died. Support it exactly the
same way as how it handles conflicting symbolic link changes --- mark it
as a conflict, take the tentative result from the current side, and
letting the caller resolve the conflict, without dying in merge_file()
function.

Also reword the error message issued when merge_file() has to die
because it sees a tree entry of type it does not support yet.

[jc: fixed up initial draft by Finn Arne Gangstad]

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

commit: do not add extra LF at the end of the summary.Junio C Hamano Tue, 11 Dec 2007 05:02:26 +0000 (21:02 -0800)

commit: do not add extra LF at the end of the summary.

The scripted version relied on the nice "auto-strip the terminating LF"
behaviour shell gives to "var=$(cmd)" construct, but we have to roll
that ourselves.

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

"git tag -u keyname" brokenLinus Torvalds Tue, 11 Dec 2007 04:08:06 +0000 (20:08 -0800)

"git tag -u keyname" broken

Commit 396865859918e9c7bf8ce74aae137c57da134610 broke signed tags using
the "-u" flag when it made builtin-tag.c use parse_options() to parse its
arguments (but it quite possibly was broken even before that, by the
builtin rewrite).

It used to be that passing the signing ID with the -u parameter also
(obviously!) implied that you wanted to sign and annotate the tag, but
that logic got dropped. It also totally ignored the actual key ID that was
passed in.

This reinstates it all.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

send-email: do not muck with initial-reply-to when... Junio C Hamano Tue, 11 Dec 2007 05:44:42 +0000 (21:44 -0800)

send-email: do not muck with initial-reply-to when unset.

When not prompting, initial_reply_to can be left unset. Do not try to
sanitize it and get useless warning.

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

Don't cache DESTDIR in perl/perl.mak.Gerrit Pape Mon, 10 Dec 2007 09:31:02 +0000 (09:31 +0000)

Don't cache DESTDIR in perl/perl.mak.

DESTDIR is supposed to be overridden on 'make install' after doing
'make'. Have the automatically generated perl/perl.mak not cache the
value of DESTDIR to support that for the perl/ subdirectory also.

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

autoconf: Check asciidoc version to automatically set... Jakub Narebski Sun, 9 Dec 2007 12:57:39 +0000 (13:57 +0100)

autoconf: Check asciidoc version to automatically set ASCIIDOC8

Check for asciidoc, and if it exists check asciidoc version, setting
ASCIIDOC8 when needed. Currently it just runs asciidoc in asciidoc7
compatibility mode (see: Documentation/Makefile).

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

git-svn: reinstate old rev_db optimization in new rev_mapEric Wong Sun, 9 Dec 2007 07:27:42 +0000 (23:27 -0800)

git-svn: reinstate old rev_db optimization in new rev_map

This reinstates an old optimization in .rev_db which
stored the highest revision number we scanned, allowing
us to avoid scanning the SVN log for those revisions
again in a subsequent invocation.

This means the last 24-byte record in a .rev_map file
can be a 4-byte SVN revision number with 20-bytes of
zeroes representing a non-existent commit. This record
can and will be overwritten when a new commit iff
the commit is all zeroes.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-svn: replace .rev_db with a more space-efficient... Eric Wong Sun, 9 Dec 2007 07:27:41 +0000 (23:27 -0800)

git-svn: replace .rev_db with a more space-efficient .rev_map format

Migrations are done automatically on an as-needed basis when new
revisions are to be fetched. Stale remote branches do not get
migrated, yet.

However, unless you set noMetadata or useSvkProps it's safe to
just do:

find $GIT_DIR/svn -name '.rev_db*' -print0 | xargs rm -f

to purge all the old .rev_db files.

The new format is a one-way migration and is NOT compatible with
old versions of git-svn.

This is the replacement for the rev_db format, which was too big
and inefficient for large repositories with a lot of sparse history
(mainly tags).

The format is this:

- 24 bytes for every record,
* 4 bytes for the integer representing an SVN revision number
* 20 bytes representing the sha1 of a git commit

- No empty padding records like the old format

- new records are written append-only since SVN revision numbers
increase monotonically

- lookups on SVN revision number are done via a binary search

- Piping the file to xxd(1) -c24 is a good way of dumping it for
viewing or editing, should the need ever arise.

As with .rev_db, these files are disposable unless noMetadata or
useSvmProps is set.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack-objects: more threaded load balancing fix with... Nicolas Pitre Mon, 10 Dec 2007 19:19:32 +0000 (14:19 -0500)

pack-objects: more threaded load balancing fix with often changed paths

The code that splits the object list amongst work threads tries to do so
on "path" boundaries not to prevent good delta matches. However, in
some cases, a few paths may largely dominate the hash distribution and
it is not possible to have good load balancing without ignoring those
boundaries.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add more checkout testsDaniel Barkalow Mon, 10 Dec 2007 03:05:34 +0000 (22:05 -0500)

Add more checkout tests

If you have local changes that don't conflict with the
branch-switching changes, these should be kept, not cause errors even
without -m, and be reported afterwards in name-status format.

With -m, the changes carried across should be listed as well. And, for
now, include the merge-recursive output from this process.

Also test the detatched head message in at least one case.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add git-browse-help to .gitignoreJeff King Mon, 10 Dec 2007 10:29:18 +0000 (05:29 -0500)

Add git-browse-help to .gitignore

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

Fix mis-markup of the -p, --patch option in git-add(1)Eyvind Bernhardsen Mon, 10 Dec 2007 13:40:20 +0000 (14:40 +0100)

Fix mis-markup of the -p, --patch option in git-add(1)

An item in a bulletted list in AsciiDoc is followed with two colons,
not just one.

Signed-off-by: Eyvind Bernhardsen <eyvind-git@orakel.ntnu.no>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-help -i: show info documentation from matching... Junio C Hamano Mon, 10 Dec 2007 09:35:29 +0000 (01:35 -0800)

git-help -i: show info documentation from matching version of git

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

git-help -i: invoke info with document and node nameJunio C Hamano Mon, 10 Dec 2007 09:19:31 +0000 (01:19 -0800)

git-help -i: invoke info with document and node name

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

Documentation: add gitman.info targetJunio C Hamano Mon, 10 Dec 2007 09:15:57 +0000 (01:15 -0800)

Documentation: add gitman.info target

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

Merge branch 'master' into cc/helpJunio C Hamano Mon, 10 Dec 2007 09:22:42 +0000 (01:22 -0800)

Merge branch 'master' into cc/help

This is to primarily pull in MANPATH tweak and help.txt formatting fix
from the master branch.

Update draft Release Notes for 1.5.4Junio C Hamano Mon, 10 Dec 2007 08:07:18 +0000 (00:07 -0800)

Update draft Release Notes for 1.5.4

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

Style fixes for pre-commit hook testsWincent Colaiuta Mon, 10 Dec 2007 07:42:45 +0000 (08:42 +0100)

Style fixes for pre-commit hook tests

As pointed out by Junio on the mailing list, surrounding tests in
double quotes can lead to bugs wherein variables get substituted away,
so this isn't just style churn but important to prevent others from
looking at these tests in the future and thinking that this is "the
way" that Git tests should be written.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Interactive editor tests for commit-msg hookWincent Colaiuta Mon, 10 Dec 2007 07:33:26 +0000 (08:33 +0100)

Interactive editor tests for commit-msg hook

Supplement the existing tests for the commit-msg hook (which all use
"git commit -m") with tests which use an interactive editor (no -m
switch) to ensure that all code paths get tested.

At the same time the quoting of some of the existing tests is changed
to conform to Junio's recommendations for test style (single quotes
used around the test unless there is a compelling reason not to, and
the opening quote on the same line as the test_expect and the closing
quote in column 1).

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Re-fix ls-remoteJunio C Hamano Sun, 9 Dec 2007 20:16:55 +0000 (12:16 -0800)

Re-fix ls-remote

An earlier attempt in 2ea7fe0 (ls-remote: resurrect pattern limit support) forgot
that the user string can also be a glob. This should finally fix it.

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

Cleanup variables in http.[ch]Mike Hommey Sun, 9 Dec 2007 17:04:57 +0000 (18:04 +0100)

Cleanup variables in http.[ch]

Quite some variables defined as extern in http.h are only used in http.c,
and some others, only defined in http.c, were not static.

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-send-email.perl: Really add angle brackets to In... Mike Hommey Sun, 9 Dec 2007 17:17:28 +0000 (18:17 +0100)

git-send-email.perl: Really add angle brackets to In-Reply-To if necessary

3803bcea tried to fix this, but it only adds the branckes when the given
In-Reply-To begins and ends with whitespaces. It also didn't do anything
to the --in-reply-to argument.

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

don't mention index refreshing side effect in git-statu... Jeff King Sun, 9 Dec 2007 08:21:34 +0000 (03:21 -0500)

don't mention index refreshing side effect in git-status docs

The tip about speeding up subsequent operations is now
obsolete; since aecbf914, git-diff now squelches empty diffs
and performs an automatic refresh.

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

Remove repo version check from setup_git_directoryNguyễn Thái Ngọc Duy Sun, 9 Dec 2007 10:14:39 +0000 (17:14 +0700)

Remove repo version check from setup_git_directory

setup_git_directory_gently has done the check already.

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

Merge branch 'jc/spht'Junio C Hamano Sun, 9 Dec 2007 09:23:48 +0000 (01:23 -0800)

Merge branch 'jc/spht'

* jc/spht:
Use gitattributes to define per-path whitespace rule
core.whitespace: documentation updates.
builtin-apply: teach whitespace_rules
builtin-apply: rename "whitespace" variables and fix styles
core.whitespace: add test for diff whitespace error highlighting
git-diff: complain about >=8 consecutive spaces in initial indent
War on whitespace: first, a bit of retreat.

Conflicts:

cache.h
config.c
diff.c

Documentation: describe -w/--web option to "git-help".Christian Couder Wed, 5 Dec 2007 05:09:40 +0000 (06:09 +0100)

Documentation: describe -w/--web option to "git-help".

Also explain that "git instaweb" may use "web.browser" config
variable.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Use {web,instaweb,help}.browser config options.Christian Couder Sun, 2 Dec 2007 05:08:00 +0000 (06:08 +0100)

Use {web,instaweb,help}.browser config options.

Now "git-instaweb" will try to use the browser configured as
"web.browser", if "instaweb.browser" is not set.

"git-browse-help" will check first "help.browser" and then
"web.browser".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-help: add -w|--web option to display html man page... Christian Couder Sun, 2 Dec 2007 05:07:55 +0000 (06:07 +0100)

git-help: add -w|--web option to display html man page in a browser.

Now when using "git help -w cmd", we will try to show the HTML man
page "git-cmd.html" in your prefered web browser.

To do that "help.c" code will call a new shell script
"git-browse-help".

This currently works only if the HTML versions of the man page
have been installed in $(htmldir) (typically "/usr/share/doc/git-doc"),
so new target to do that is added to "Documentation/Makefile".

The browser to use can be configured using the "web.browser"
config variable.

We try to open a new tab in an existing web browser, if possible.

The code in "git-browse-help" is heavily stolen from "git-mergetool"
by Theodore Y. Ts'o. Thanks.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'pr/mergetool'Junio C Hamano Sun, 9 Dec 2007 09:01:50 +0000 (01:01 -0800)

Merge branch 'pr/mergetool'

* pr/mergetool:
Open external merge tool with original file extensions for all three files

Merge branch 'maint'Junio C Hamano Sun, 9 Dec 2007 08:56:44 +0000 (00:56 -0800)

Merge branch 'maint'

* maint:
config.c:store_write_pair(): don't read the byte before a malloc'd buffer.

Re-fix "builtin-commit: fix --signoff"Junio C Hamano Sun, 9 Dec 2007 01:32:08 +0000 (17:32 -0800)

Re-fix "builtin-commit: fix --signoff"

An earlier fix to the said commit was incomplete; it mixed up the
meaning of the flag parameter passed to the internal fmt_ident()
function, so this corrects it.

git_author_info() and git_committer_info() can be told to issue a
warning when no usable user information is found, and optionally can be
told to error out. Operations that actually use the information to
record a new commit or a tag will still error out, but the caller to
leave reflog record will just silently use bogus user information.

Not warning on misconfigured user information while writing a reflog
entry is somewhat debatable, but it is probably nicer to the users to
silently let it pass, because the only information you are losing is who
checked out the branch.

* git_author_info() and git_committer_info() used to take 1 (positive
int) to error out with a warning on misconfiguration; this is now
signalled with a symbolic constant IDENT_ERROR_ON_NO_NAME.

* These functions used to take -1 (negative int) to warn but continue;
this is now signalled with a symbolic constant IDENT_WARN_ON_NO_NAME.

* fmt_ident() function implements the above error reporting behaviour
common to git_author_info() and git_committer_info(). A symbolic
constant IDENT_NO_DATE can be or'ed in to the flag parameter to make
it return only the "Name <email@address.xz>".

* fmt_name() is a thin wrapper around fmt_ident() that always passes
IDENT_ERROR_ON_NO_NAME and IDENT_NO_DATE.

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

Add tests for pre-commit and commit-msg hooksWincent Colaiuta Sat, 8 Dec 2007 12:29:47 +0000 (13:29 +0100)

Add tests for pre-commit and commit-msg hooks

As desired, these pass for git-commit.sh, fail for builtin-commit (prior
to the fixes), and succeeded for builtin-commit (after the fixes).

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix commit-msg hook to allow editingJunio C Hamano Sun, 9 Dec 2007 07:23:20 +0000 (23:23 -0800)

Fix commit-msg hook to allow editing

The old git-commit.sh script allowed the commit-msg hook to not only
prevent a commit from proceding, but also to edit the commit message
on the fly and allow it to proceed. So here we teach builtin-commit
to do the same.

This is based on Wincent's patch, but redone with a clarified logic.

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

Documentation: fix --no-verify documentation for "git... Wincent Colaiuta Sat, 8 Dec 2007 11:38:08 +0000 (12:38 +0100)

Documentation: fix --no-verify documentation for "git commit"

The documentation for the --no-verify switch should mention the
commit-msg hook, not just the pre-commit hook.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Allow --no-verify to bypass commit-msg hookWincent Colaiuta Sat, 8 Dec 2007 11:38:07 +0000 (12:38 +0100)

Allow --no-verify to bypass commit-msg hook

At the moment the --no-verify switch to "git commit" instructs it to
skip over the pre-commit hook. Here we teach "git commit --no-verify"
to skip over the commit-msg hook as well. This brings the behaviour
of builtin-commit back in line with git-commit.sh.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

ls-remote: resurrect pattern limit supportJunio C Hamano Sun, 9 Dec 2007 06:52:59 +0000 (22:52 -0800)

ls-remote: resurrect pattern limit support

"git ls-remote $remote $name1 $name2..." used to limit the output to
refs that end with one of the $name given from the command line, but
recent rewrite to C forgot to implement that support.

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

config.c:store_write_pair(): don't read the byte before... Jim Meyering Sat, 8 Dec 2007 15:48:05 +0000 (16:48 +0100)

config.c:store_write_pair(): don't read the byte before a malloc'd buffer.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-shortlog -e: show e-mail address as wellJunio C Hamano Sat, 8 Dec 2007 01:19:31 +0000 (17:19 -0800)

git-shortlog -e: show e-mail address as well

This option shows the author's email address next to the name.

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