Code

git.git
15 years agodaemon: cleanup: replace loop with if
René Scharfe [Fri, 26 Dec 2008 10:01:57 +0000 (11:01 +0100)]
daemon: cleanup: replace loop with if

Replace a loop around an enter_repo() call, which was used to retry
a single time with a different parameter in case the first call fails,
with two calls and an if.  This is shorter and cleaner.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodaemon: handle freopen() failure
René Scharfe [Fri, 26 Dec 2008 09:46:25 +0000 (10:46 +0100)]
daemon: handle freopen() failure

Die if stderr couldn't be sent to /dev/null when operating in inetd
mode and report the error message from the OS.

This fixes a compiler warning about the return value of freopen()
being ignored on Ubuntu 8.10.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodescribe: Avoid unnecessary warning when using --all
Shawn O. Pearce [Fri, 26 Dec 2008 22:02:01 +0000 (14:02 -0800)]
describe: Avoid unnecessary warning when using --all

In 212945d4 ("Teach git-describe to verify annotated tag names
before output") git-describe learned how to output a warning if
an annotated tag object was matched but its internal name doesn't
match the local ref name.

However, "git describe --all" causes the local ref name to be
prefixed with "tags/", so we need to skip over this prefix before
comparing the local ref name with the name recorded inside of the
tag object.

Patch-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agols-tree: add --full-tree option
Junio C Hamano [Fri, 26 Dec 2008 00:54:23 +0000 (16:54 -0800)]
ls-tree: add --full-tree option

The established behaviour of "git ls-tree $tree_ish" run from a subdirectory
"sub/dir" in a work tree is to limit the output to the paths in the
subdirectory, and strip off the leading "sub/dir" from the output, since
3c5e846 (ls-tree: major rewrite to do pathspec, 2005-11-26).

This was a "usability" feature made back in the days when the line between
Porcelain and plumbing was blurry, and in retrospect, it probably was
misguided.  The behaviour may be what the end user would expect when the
command is run interactively from a subdirectory, but it also means that a
scripted Porcelain that wants to use the command to list the full contents
of a tree object has to do cd_to_toplevel (and save the output from
"rev-parse --show-prefix" before doing so, so that it can be used as a
pathspec if it wants to limit its operation to the original subdirectory
in other commands).

This new option makes the command operate on the full tree object,
regardless of where in the work tree it is run from.  It also implies the
behaviour that is triggered by the existing --full-name option.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agomerge-recursive: mark rename/delete conflict as unmerged
Johannes Schindelin [Mon, 22 Dec 2008 22:10:20 +0000 (23:10 +0100)]
merge-recursive: mark rename/delete conflict as unmerged

When a file was renamed in one branch, but deleted in the other, one
should expect the index to contain an unmerged entry, namely the
target of the rename.  Make it so.

Noticed by Constantine Plotnikov.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agohttp-push: support full URI in handle_remote_ls_ctx()
Kirill A. Korinskiy [Tue, 23 Dec 2008 08:31:15 +0000 (11:31 +0300)]
http-push: support full URI in handle_remote_ls_ctx()

The program calls remote_ls() to get list of files from the server over
HTTP; handle_remote_ls_ctx() is used to parse its response to populate
"struct remote_ls_ctx" that is returned from remote_ls().

The handle_remote_ls_ctx() function assumed that the server returns a
local path in href field, but RFC 4918 (14.7) demand of support full URI
(e.g. "http://localhost:8080/repo.git").

This resulted in push failure (e.g. git-http-push issues a PROPFIND
request to "/repo.git/alhost:8080/repo.git/refs/" to the server).

Signed-off-by: Kirill A. Korinskiy <catap@catap.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoGIT 1.6.1 v1.6.1
Junio C Hamano [Thu, 25 Dec 2008 03:41:08 +0000 (19:41 -0800)]
GIT 1.6.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'js/rebase-i-p'
Junio C Hamano [Wed, 24 Dec 2008 08:14:14 +0000 (00:14 -0800)]
Merge branch 'js/rebase-i-p'

* js/rebase-i-p:
  rebase -i -p: leave a --cc patch when a merge could not be redone
  rebase -i -p: Fix --continue after a merge could not be redone
  Show a failure of rebase -p if the merge had a conflict

15 years agorebase -i -p: leave a --cc patch when a merge could not be redone
Johannes Schindelin [Mon, 22 Dec 2008 21:16:51 +0000 (22:16 +0100)]
rebase -i -p: leave a --cc patch when a merge could not be redone

The result is easier to review this way, and the merge resolution has to be
done inside the work tree, not by adjusting "the patch" anyway.

15 years agot9129: skip the last three tests if UTF-8 locale is not available
Miklos Vajna [Tue, 23 Dec 2008 01:09:24 +0000 (02:09 +0100)]
t9129: skip the last three tests if UTF-8 locale is not available

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoGIT 1.6.1-rc4 v1.6.1-rc4
Junio C Hamano [Mon, 22 Dec 2008 03:20:21 +0000 (19:20 -0800)]
GIT 1.6.1-rc4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAlways show which directory is not a git repository
Richard Hartmann [Sun, 21 Dec 2008 23:17:32 +0000 (00:17 +0100)]
Always show which directory is not a git repository

Unify all

  fatal: Not a git repository

error messages so they include path information.

Signed-off-by: Richard Hartmann <richih@net.in.tum.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMake help entries alphabetical
Richard Hartmann [Sun, 21 Dec 2008 22:28:25 +0000 (23:28 +0100)]
Make help entries alphabetical

Signed-off-by: Richard Hartmann <richih@net.in.tum.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Mon, 22 Dec 2008 02:35:54 +0000 (18:35 -0800)]
Merge branch 'maint'

* maint:
  doc/git-fsck: change the way for getting heads' SHA1s

15 years agogit-revert documentation: refer to new HOWTO on reverting faulty merges
Boyd Stephen Smith Jr [Mon, 22 Dec 2008 00:26:03 +0000 (18:26 -0600)]
git-revert documentation: refer to new HOWTO on reverting faulty merges

Signed-off-by: Boyd Stephen Smith Jr <bss@iguanasuicide.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-revert: record the parent against which a revert was made
Robin Rosenberg [Sun, 21 Dec 2008 22:17:12 +0000 (14:17 -0800)]
git-revert: record the parent against which a revert was made

As described in Documentation/howto/revert-a-faulty-merge.txt, re-merging
from a previously reverted a merge of a side branch may need a revert of
the revert beforehand.  Record against which parent the revert was made in
the commit, so that later the user can figure out what went on.

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge git://git.kernel.org/pub/scm/gitk/gitk
Junio C Hamano [Mon, 22 Dec 2008 02:31:12 +0000 (18:31 -0800)]
Merge git://git.kernel.org/pub/scm/gitk/gitk

* git://git.kernel.org/pub/scm/gitk/gitk:
  gitk: Force the focus to the main window on Windows
  gitk: Allow unbalanced quotes/braces in commit headers
  gitk: Update German translation
  gitk: Mark forgotten strings (header sentence parts in color chooser) for translation
  gitk: Ensure that "Reset branch" menu entry is enabled
  gitk: Use check-buttons' -text property instead of separate labels
  gitk: Map / to focus the search box
  gitk: Fix bugs in blaming code

15 years agogitk: Force the focus to the main window on Windows
Johannes Sixt [Thu, 18 Dec 2008 07:30:49 +0000 (08:30 +0100)]
gitk: Force the focus to the main window on Windows

On msysGit, the focus is first on the (Tk) console.  This console is then
hidden, but keeps the focus.  Work around that by forcing the focus onto
the gitk window.

This fixes msysGit issue 14.  Diagnosed and originally fixed by
Johannes Schindelin.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agogitk: Allow unbalanced quotes/braces in commit headers
Kevin Ballard [Thu, 18 Dec 2008 09:26:48 +0000 (01:26 -0800)]
gitk: Allow unbalanced quotes/braces in commit headers

When parsing commits, gitk treats the headers of the commit as tcl
lists.  This causes errors if the header contains an unbalanced quote
or open brace.  Splitting the line on spaces allows us to treat it as
a set of words instead of as a tcl list, which prevents errors.

Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agogitk: Update German translation
Christian Stimming [Sat, 6 Dec 2008 19:49:24 +0000 (20:49 +0100)]
gitk: Update German translation

Attached to avoid whitespace problems.

Regards,

Christian

From 282060ac531fee722142f9d39c4ff29570723cbb Mon Sep 17 00:00:00 2001
From: Christian Stimming <stimming@tuhh.de>
Date: Sat, 6 Dec 2008 20:47:15 +0100
Subject: [PATCH 2/2] gitk: Update German translation

Merged with most recent "make update-po" result.

Signed-off-by: Christian Stimming <stimming@tuhh.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agogitk: Mark forgotten strings (header sentence parts in color chooser) for translation
Christian Stimming [Sat, 6 Dec 2008 19:48:30 +0000 (20:48 +0100)]
gitk: Mark forgotten strings (header sentence parts in color chooser) for translation

Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agogitk: Ensure that "Reset branch" menu entry is enabled
Johannes Sixt [Wed, 3 Dec 2008 12:43:20 +0000 (13:43 +0100)]
gitk: Ensure that "Reset branch" menu entry is enabled

Consider this sequence of events:

1. Detach HEAD and fire up gitk
2. Call the context menu on some commit. Notice that the last menu entry
   says "Detached HEAD: can't reset" and it is disabled.
3. Now checkout some regular branch (e.g. 'master') using the context menu.
4. Call the context menu again on some commit.

Previously, at this point the last menu entry said "Reset master branch
to here", but it was still disabled. With this fix it is now enabled again.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agogitk: Use check-buttons' -text property instead of separate labels
Johannes Sixt [Tue, 2 Dec 2008 20:42:16 +0000 (21:42 +0100)]
gitk: Use check-buttons' -text property instead of separate labels

Previously the check-buttons' labels in the Preferences were separate
widgets.  This had the disadvantage that in order to toggle the
check-button with the mouse the check-box had to be clicked.  With
this change the check-box can also be toggled by clicking the label.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agogitk: Map / to focus the search box
Giuseppe Bilotta [Tue, 2 Dec 2008 01:19:22 +0000 (02:19 +0100)]
gitk: Map / to focus the search box

The / key is often used to initiate searches (less, vim, some web
browsers).  This changes the binding for the / (slash) key from 'find
next' to 'focus the search box' to follow this convention.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
15 years agodoc/git-fsck: change the way for getting heads' SHA1s
Markus Heidelberg [Sun, 21 Dec 2008 16:30:22 +0000 (17:30 +0100)]
doc/git-fsck: change the way for getting heads' SHA1s

The straightforward way with using 'cat .git/refs/heads/*' doesn't work
with packed refs as well as branches of the form topic/topic1. So let's
use git-for-each-ref for getting the heads' SHA1s in this example.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation/git-show-branch: work around "single quote" typesetting glitch
Markus Heidelberg [Sun, 21 Dec 2008 10:00:31 +0000 (02:00 -0800)]
Documentation/git-show-branch: work around "single quote" typesetting glitch

The displayed example is typeset with acute accents around the string that
should be surrounded by a pair of single quotes in manpage.  Replace them
with double quotes (the semantics of the example does not change).

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agosend-email: futureproof split_addrs() sub
Junio C Hamano [Sun, 21 Dec 2008 09:57:59 +0000 (01:57 -0800)]
send-email: futureproof split_addrs() sub

Matt Kraai points out that calling parse_line() assuming that the caller
ever passes only one argument is a bug waiting to happen, and he is
right.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMake sure lockfiles are unlocked when dying on SIGPIPE
Junio C Hamano [Fri, 19 Dec 2008 01:31:57 +0000 (17:31 -0800)]
Make sure lockfiles are unlocked when dying on SIGPIPE

We cleaned up lockfiles upon receiving the usual suspects HUP, TERM, QUIT
but a wicked user could kill us of asphyxiation by piping our output to a
pipe that does not read.  Protect ourselves by catching SIGPIPE and clean
up the lockfiles as well in such a case.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofast-import.c: stricter strtoul check, silence compiler warning
René Scharfe [Sun, 21 Dec 2008 01:28:48 +0000 (02:28 +0100)]
fast-import.c: stricter strtoul check, silence compiler warning

Store the return value of strtoul() in order to avoid compiler
warnings on Ubuntu 8.10.

Also check errno after each call, which is the only way to notice
an overflow without making ULONG_MAX an illegal date.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoconnect.c: stricter port validation, silence compiler warning
René Scharfe [Sun, 21 Dec 2008 01:12:11 +0000 (02:12 +0100)]
connect.c: stricter port validation, silence compiler warning

In addition to checking if the provided port is numeric, also check
that the string isn't empty and that the port number is within the
valid range.  Incidentally, this silences a compiler warning about
ignoring strtol's return value.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAdd a documentat on how to revert a faulty merge
Nanako Shiraishi [Sat, 20 Dec 2008 11:27:02 +0000 (20:27 +0900)]
Add a documentat on how to revert a faulty merge

Linus and Junio explained issues that are involved in reverting a merge
and how to continue working with a branch that was updated since such a
revert on the mailing list.  This is to help new people who did not see
these messages.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoRemove the requirement opaquelocktoken uri scheme
Kirill A. Korinskiy [Sat, 20 Dec 2008 06:19:46 +0000 (09:19 +0300)]
Remove the requirement opaquelocktoken uri scheme

The program flow of pushing over http is:

 - call lock_remote() to issue a DAV_LOCK request to the server to lock
   info/refs and branch refs being pushed into; handle_new_lock_ctx() is
   used to parse its response to populate "struct remote_lock" that is
   returned from lock_remote();

 - send objects;

 - call unlock_remote() to drop the lock.

The handle_new_lock_ctx() function assumed that the server will use a
lock token in opaquelocktoken URI scheme, which may have been an Ok
assumption under RFC 2518, but under RFC 4918 which obsoletes the older
standard it is not necessarily true.

This resulted in push failure (often resulted in "cannot lock existing
info/refs" error message) when talking to a server that does not use
opaquelocktoken URI scheme.

Signed-off-by: Kirill A. Korinskiy <catap@catap.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb: link to patch(es) view in commit(diff) and (short)log view
Giuseppe Bilotta [Thu, 18 Dec 2008 07:13:19 +0000 (08:13 +0100)]
gitweb: link to patch(es) view in commit(diff) and (short)log view

We link to patch view in commit and commitdiff view, and to patches view
in log and shortlog view.

In (short)log view, the link is only offered when the number of commits
shown is no more than the allowed maximum number of patches.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb: add patches view
Giuseppe Bilotta [Thu, 18 Dec 2008 07:13:18 +0000 (08:13 +0100)]
gitweb: add patches view

The only difference between patch and patches view is in the treatement
of single commits: the former only displays a single patch, whereas the
latter displays a patchset leading to the specified commit.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb: change call pattern for git_commitdiff
Giuseppe Bilotta [Thu, 18 Dec 2008 07:13:17 +0000 (08:13 +0100)]
gitweb: change call pattern for git_commitdiff

Since we are going to introduce an additional parameter for
git_commitdiff to tune patch view, we switch to named/hash-based
parameter passing for clarity and robustness.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb: add patch view
Giuseppe Bilotta [Thu, 18 Dec 2008 07:13:16 +0000 (08:13 +0100)]
gitweb: add patch view

The output of commitdiff_plain is not intended for git-am:
 * when given a range of commits, commitdiff_plain publishes a single
   patch with the message from the first commit, instead of a patchset
 * the hand-built email format replicates the commit summary both as
   email subject and as first line of the email itself, resulting in
   a duplication if the output is used with git-am.

We thus create a new view that can be fed to git-am directly, allowing
patch exchange via gitweb. The new view exposes the output of git
format-patch directly, limiting it to a single patch in the case of a
single commit.

A configurable upper limit defaulting to 16 is imposed on the number of
commits which will be included in a patchset, to prevent DoS attacks on
the server. Setting the limit to 0 will disable the patch view, setting
it to a negative number will remove the limit.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-sh-setup: Fix scripts whose PWD is a symlink into a git work-dir
Marcel M. Cary [Mon, 15 Dec 2008 17:34:37 +0000 (09:34 -0800)]
git-sh-setup: Fix scripts whose PWD is a symlink into a git work-dir

I want directories of my working tree to be linked to from various
paths on my filesystem where third-party components expect them, both
in development and production environments.  A build system's install
step could solve this, but I develop scripts and web pages that don't
need to be built.  Git's submodule system could solve this, but we
tend to develop, branch, and test those directories all in unison, so
one big repository feels more natural.  We prefer to edit and commit
on the symlinked paths, not the canonical ones, and in that setting,
"git pull" fails to find the top-level directory of the repository
while other commands work fine.

"git pull" fails because POSIX shells have a notion of current working
directory that is different from getcwd().  The shell stores this path
in PWD.  As a result, "cd ../" can be interpreted differently in a
shell script than chdir("../") in a C program.  The shell interprets
"../" by essentially stripping the last textual path component from
PWD, whereas C chdir() follows the ".." link in the current directory
on the filesystem.  When PWD is a symlink, these are different
destinations.  As a result, Git's C commands find the correct
top-level working tree, and shell scripts do not.

Changes:

* When interpreting a relative upward (../) path in cd_to_toplevel,
  prepend the cwd without symlinks, given by /bin/pwd
* Add tests for cd_to_toplevel and "git pull" in a symlinked
  directory that failed before this fix, plus contrasting scenarios
  that already worked

Signed-off-by: Marcel M. Cary <marcel@oak.homeunix.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agorebase -i -p: Fix --continue after a merge could not be redone
Johannes Sixt [Mon, 15 Dec 2008 10:05:31 +0000 (11:05 +0100)]
rebase -i -p: Fix --continue after a merge could not be redone

When a merge that has a conflict was rebased, then rebase stopped to let
the user resolve the conflicts. However, thereafter --continue failed
because the author-script was not saved. (This is rebase -i's way to
preserve a commit's authorship.) This fixes it by doing taking the same
failure route after a merge that is also taken after a normal cherry-pick.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoShow a failure of rebase -p if the merge had a conflict
Johannes Sixt [Mon, 15 Dec 2008 10:05:30 +0000 (11:05 +0100)]
Show a failure of rebase -p if the merge had a conflict

This extends t3409-rebase-preserve-merges by a case where the merge that
is rebased has a conflict. Therefore, the rebase stops and expects that
the user resolves the conflict. However, currently rebase --continue
fails because .git/rebase-merge/author-script is missing.

The test script had allocated two identical clones, but only one of them
(clone2) was used. Now we use both as indicated in the comment. Also,
two instances of && was missing in the setup part.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: fix typos, grammar, asciidoc syntax
Markus Heidelberg [Fri, 19 Dec 2008 12:14:18 +0000 (13:14 +0100)]
Documentation: fix typos, grammar, asciidoc syntax

[jc: the original patch was against master but 99% of it
 applied to maint; this commit splits out the part that
 applies only to master.]

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint' to sync with GIT 1.6.0.6
Junio C Hamano [Sat, 20 Dec 2008 03:32:29 +0000 (19:32 -0800)]
Merge branch 'maint' to sync with GIT 1.6.0.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoGIT 1.6.0.6 v1.6.0.6
Junio C Hamano [Sat, 20 Dec 2008 03:27:06 +0000 (19:27 -0800)]
GIT 1.6.0.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofast-import: make tagger information optional
Junio C Hamano [Fri, 19 Dec 2008 22:41:21 +0000 (14:41 -0800)]
fast-import: make tagger information optional

Even though newer Porcelain tools always record the tagger information
when creating new tags, export/import pair should be able to faithfully
reproduce ancient tag objects that lack tagger information.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
15 years agofast-export: deal with tag objects that do not have a tagger
Johannes Schindelin [Sat, 20 Dec 2008 00:00:27 +0000 (01:00 +0100)]
fast-export: deal with tag objects that do not have a tagger

When no tagger was found (old Git produced tags like this),
no "tagger" line is printed (but this is incompatible with the current
git fast-import).

Alternatively, you can pass the option --fake-missing-tagger, forcing
fast-export to fake a tagger

Unspecified Tagger <no-tagger>

with a tag date of the beginning of (Unix) time in the case of a missing
tagger, so that fast-import is still able to import the result.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoSubmittingPatches: mention the usage of real name in Signed-off-by: lines
Miklos Vajna [Sat, 20 Dec 2008 00:52:17 +0000 (01:52 +0100)]
SubmittingPatches: mention the usage of real name in Signed-off-by: lines

Especially with something that is supposed to hopefully have some legal
value down the line if somebody starts making noises, it really would be
nice to have a real person to associate things with. Suggest this in the
SubmittingPatches document.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-mergetool: properly handle "git mergetool -- filename"
David Aguilar [Sat, 20 Dec 2008 01:01:01 +0000 (17:01 -0800)]
git-mergetool: properly handle "git mergetool -- filename"

Like many git commands, git-mergetool allows "--" to signal
the end of option processing.  This adds a missing "shift"
statement so that this is correctly handled.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-send-email: handle email address with quoted comma
Wu Fengguang [Fri, 19 Dec 2008 08:10:10 +0000 (16:10 +0800)]
git-send-email: handle email address with quoted comma

Correctly handle email addresses containing quoted commas, e.g.

    "Zhu, Yi" <yi.zhu@intel.com>, "Li, Shaohua" <shaohua.li@intel.com>

The commas inside the double quotes are not separators.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: fix typos, grammar, asciidoc syntax
Markus Heidelberg [Fri, 19 Dec 2008 12:14:18 +0000 (13:14 +0100)]
Documentation: fix typos, grammar, asciidoc syntax

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: sync example output with git output
Markus Heidelberg [Fri, 19 Dec 2008 12:14:52 +0000 (13:14 +0100)]
Documentation: sync example output with git output

Don't confuse the user with old git messages.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix type-mismatch compiler warning from diff_populate_filespec()
René Scharfe [Thu, 18 Dec 2008 16:56:51 +0000 (17:56 +0100)]
Fix type-mismatch compiler warning from diff_populate_filespec()

The type of the size member of filespec is ulong, while strbuf_detach expects
a size_t pointer.  This patch should fix the warning:

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agotest overlapping ignore patterns
Michael J Gruber [Thu, 18 Dec 2008 17:11:18 +0000 (18:11 +0100)]
test overlapping ignore patterns

Add a test which checks that negated patterns such as "!foo.html" can
override previous patterns such as "*.html". This is documented
behaviour but had not been tested so far.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'lt/readlink'
Junio C Hamano [Thu, 18 Dec 2008 06:28:03 +0000 (22:28 -0800)]
Merge branch 'lt/readlink'

* lt/readlink:
  combine-diff.c: use strbuf_readlink()
  builtin-blame.c: use strbuf_readlink()
  make_absolute_path(): check bounds when seeing an overlong symlink
  Make 'prepare_temp_file()' ignore st_size for symlinks
  Make 'diff_populate_filespec()' use the new 'strbuf_readlink()'
  Make 'index_path()' use 'strbuf_readlink()'
  Make 'ce_compare_link()' use the new 'strbuf_readlink()'
  Add generic 'strbuf_readlink()' helper function

15 years agoEnable threaded delta search on Mac OS X/Darwin
Arjen Laarhoven [Wed, 17 Dec 2008 08:20:25 +0000 (09:20 +0100)]
Enable threaded delta search on Mac OS X/Darwin

Signed-off-by: Arjen Laarhoven <arjen@yaph.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoClarify documentation of "git checkout <tree-ish> paths" syntax
Nanako Shiraishi [Thu, 18 Dec 2008 03:34:56 +0000 (12:34 +0900)]
Clarify documentation of "git checkout <tree-ish> paths" syntax

The SYNOPSIS section of the manual writes:

    git checkout [options] [<tree-ish>] [--] <paths>...

but the DESCRIPTION says that this form checks the paths out "from the
index, or from a named commit."  A later sentence refers to the same
argument as "<tree-ish> argument", but it is not clear that these two
sentences are talking about the same command line argument for first-time
readers.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge git://repo.or.cz/git-gui
Junio C Hamano [Thu, 18 Dec 2008 05:56:48 +0000 (21:56 -0800)]
Merge git://repo.or.cz/git-gui

* git://repo.or.cz/git-gui:
  git-gui 0.12
  git-gui: Get rid of the last remnants of GIT_CONFIG_LOCAL
  git-gui: Update Hungarian translation for 0.12
  git-gui: Fixed typos in Swedish translation.
  git-gui: Updated Swedish translation (515t0f0u).
  git gui: update Italian translation
  git-gui: Update Japanese translation for 0.12
  git-gui: Starting translation for Norwegian
  git-gui: Update German (completed) translation.
  git-gui: Update po template to include 'Mirroring %s' message
  git-gui: Fix commit encoding handling.
  git-gui: Fix handling of relative paths in blame.

15 years agogit-gui 0.12 gitgui-0.12.0
Shawn O. Pearce [Thu, 18 Dec 2008 04:15:17 +0000 (20:15 -0800)]
git-gui 0.12

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogithooks documentation: add a note about the +x mode
Miklos Vajna [Wed, 17 Dec 2008 21:29:06 +0000 (22:29 +0100)]
githooks documentation: add a note about the +x mode

In a freshly initialized repo it is only necessary to rename the .sample
hooks, but when using older repos (initialized with older git init)
enabled the +x mode is still necessary - docuement this.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocombine-diff.c: use strbuf_readlink()
Junio C Hamano [Wed, 17 Dec 2008 20:37:58 +0000 (12:37 -0800)]
combine-diff.c: use strbuf_readlink()

When showing combined diff using work tree contents, use strbuf_readlink()
to read symbolic links.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agobuiltin-blame.c: use strbuf_readlink()
Junio C Hamano [Wed, 17 Dec 2008 20:37:53 +0000 (12:37 -0800)]
builtin-blame.c: use strbuf_readlink()

When faking a commit out of the work tree contents, use strbuf_readlink()
to read the contents of symbolic links.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agomake_absolute_path(): check bounds when seeing an overlong symlink
Junio C Hamano [Wed, 17 Dec 2008 20:37:48 +0000 (12:37 -0800)]
make_absolute_path(): check bounds when seeing an overlong symlink

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
15 years agoMake 'prepare_temp_file()' ignore st_size for symlinks
Linus Torvalds [Wed, 17 Dec 2008 18:31:36 +0000 (10:31 -0800)]
Make 'prepare_temp_file()' ignore st_size for symlinks

The code was already set up to not really need it, so this just massages
it a bit to remove the use entirely.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMake 'diff_populate_filespec()' use the new 'strbuf_readlink()'
Linus Torvalds [Wed, 17 Dec 2008 18:26:13 +0000 (10:26 -0800)]
Make 'diff_populate_filespec()' use the new 'strbuf_readlink()'

This makes all tests pass on a system where 'lstat()' has been hacked to
return bogus data in st_size for symlinks.

Of course, the test coverage isn't complete, but it's a good baseline.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMake 'index_path()' use 'strbuf_readlink()'
Linus Torvalds [Wed, 17 Dec 2008 17:51:53 +0000 (09:51 -0800)]
Make 'index_path()' use 'strbuf_readlink()'

This makes us able to properly index symlinks even on filesystems where
st_size doesn't match the true size of the link.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMake 'ce_compare_link()' use the new 'strbuf_readlink()'
Linus Torvalds [Wed, 17 Dec 2008 17:47:27 +0000 (09:47 -0800)]
Make 'ce_compare_link()' use the new 'strbuf_readlink()'

This simplifies the code, and also makes ce_compare_link now able to
handle filesystems with odd 'st_size' return values for symlinks.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAdd generic 'strbuf_readlink()' helper function
Linus Torvalds [Wed, 17 Dec 2008 17:36:40 +0000 (09:36 -0800)]
Add generic 'strbuf_readlink()' helper function

It was already what 'git apply' did in read_old_data(), just export it
as a real function, and make it be more generic.

In particular, this handles the case of the lstat() st_size data not
matching the readlink() return value properly (which apparently happens
at least on NTFS under Linux).  But as a result of this you could also
use the new function without even knowing how big the link is going to
be, and it will allocate an appropriately sized buffer.

So we pass in the st_size of the link as just a hint, rather than a
fixed requirement.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-gui: Get rid of the last remnants of GIT_CONFIG_LOCAL
Johannes Schindelin [Sun, 14 Dec 2008 22:12:49 +0000 (23:12 +0100)]
git-gui: Get rid of the last remnants of GIT_CONFIG_LOCAL

In dc871831(Only use GIT_CONFIG in "git config", not other programs),
GIT_CONFIG_LOCAL was rested in peace, in favor of not reading
/etc/gitconfig and $HOME/.gitconfig at all when GIT_CONFIG is set.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agodoc/git-reset: add reference to git-stash
Markus Heidelberg [Wed, 17 Dec 2008 02:59:36 +0000 (03:59 +0100)]
doc/git-reset: add reference to git-stash

The "Interrupted workflow" situation is a good example for using
git-stash.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: fix description for enabling hooks
Markus Heidelberg [Wed, 17 Dec 2008 02:59:23 +0000 (03:59 +0100)]
Documentation: fix description for enabling hooks

Since f98f8cb (Ship sample hooks with .sample suffix, 2008-06-24) hooks
are not enabled by making them executable anymore, but by removing the
'.sample' suffix from the filename.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-daemon documentation: use {tilde}
Miklos Vajna [Tue, 16 Dec 2008 15:48:12 +0000 (16:48 +0100)]
git-daemon documentation: use {tilde}

Use '{tilde}' instead of '~', becase the later does not appear in the
manpage version, just in the HTML one.

Noticed by gonzzor on IRC.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb: do not run "git diff" that is Porcelain
Junio C Hamano [Wed, 17 Dec 2008 03:42:02 +0000 (19:42 -0800)]
gitweb: do not run "git diff" that is Porcelain

Jakub says that legacy-style URI to view two blob differences are never
generated since 1.4.3.  This codepath runs "git diff" Porcelain from the
gitweb, which is a no-no.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoGIT 1.5.6.6 v1.5.6.6
Junio C Hamano [Wed, 17 Dec 2008 06:13:36 +0000 (22:13 -0800)]
GIT 1.5.6.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoGIT 1.5.5.6 v1.5.5.6
Junio C Hamano [Wed, 17 Dec 2008 06:08:22 +0000 (22:08 -0800)]
GIT 1.5.5.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoGIT 1.5.4.7 v1.5.4.7
Junio C Hamano [Wed, 17 Dec 2008 06:03:29 +0000 (22:03 -0800)]
GIT 1.5.4.7

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb: do not run "git diff" that is Porcelain
Junio C Hamano [Wed, 17 Dec 2008 03:42:02 +0000 (19:42 -0800)]
gitweb: do not run "git diff" that is Porcelain

Jakub says that legacy-style URI to view two blob differences are never
generated since 1.4.3.  This codepath runs "git diff" Porcelain from the
gitweb, which is a no-no.  It can trigger diff.external command that is
specified in the configuration file of the repository being viewed.

This patch applies to v1.5.4 and later.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash completion: Sync config variables with their man pages
Lee Marlow [Mon, 15 Dec 2008 17:45:49 +0000 (10:45 -0700)]
bash completion: Sync config variables with their man pages

Add 'normal' to config color options.
Add 'mergeoptions' to branch config options.
Add 'proxy' and 'mirror' to remote config options.

Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash completion: Sort config completion variables
Lee Marlow [Mon, 15 Dec 2008 17:45:48 +0000 (10:45 -0700)]
bash completion: Sort config completion variables

Sort the config variables to make sync-ing them with
Documents/config.txt easier in the future.

Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Tue, 16 Dec 2008 07:06:13 +0000 (23:06 -0800)]
Merge branch 'maint'

* maint:
  fast-import: close pack before unlinking it
  pager: do not dup2 stderr if it is already redirected
  git-show: do not segfault when showing a bad tag

15 years agofast-import: close pack before unlinking it
Johannes Schindelin [Mon, 15 Dec 2008 21:11:40 +0000 (22:11 +0100)]
fast-import: close pack before unlinking it

This is sort of a companion patch to 4723ee9(Close files opened by
lock_file() before unlinking.): on Windows, you cannot delete what
is still open.

This makes test 9300-fast-import pass on Windows for me; quite a few
fast-imports leave temporary packs until the test "blank lines not
necessary after other commands" actually tests for the number of files
in .git/objects/pack/, which has a few temporary packs now.

I guess that 8b4eb6b(Do not perform cross-directory renames when
creating packs) was "responsible" for the breakage.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb: unify boolean feature subroutines
Matt Kraai [Tue, 16 Dec 2008 06:16:19 +0000 (22:16 -0800)]
gitweb: unify boolean feature subroutines

The boolean feature subroutines behaved identically except for the
name of the configuration option, so make that a parameter and unify
them.

Signed-off-by: Matt Kraai <kraai@ftbfs.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoForce t5302 to use a single thread
Johannes Schindelin [Mon, 15 Dec 2008 19:44:30 +0000 (20:44 +0100)]
Force t5302 to use a single thread

If the packs are made using multiple threads, they are no longer identical
on the 4-core Xeon I tested on.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'cb/maint-merge-recursive-fix' into cb/merge-recursive-fix
Junio C Hamano [Mon, 15 Dec 2008 10:41:24 +0000 (02:41 -0800)]
Merge branch 'cb/maint-merge-recursive-fix' into cb/merge-recursive-fix

* cb/maint-merge-recursive-fix:
  merge-recursive: do not clobber untracked working tree garbage
  modify/delete conflict resolution overwrites untracked file

15 years agomerge-recursive: do not clobber untracked working tree garbage
Junio C Hamano [Mon, 15 Dec 2008 03:40:09 +0000 (19:40 -0800)]
merge-recursive: do not clobber untracked working tree garbage

When merge-recursive wanted to create a new file in the work tree (either
as the final result, or a hint for reference purposes while delete/modify
conflicts), it unconditionally overwrote an untracked file in the working
tree.  Be careful not to lose whatever the user has that is not tracked.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agomodify/delete conflict resolution overwrites untracked file
Clemens Buchacher [Wed, 10 Dec 2008 20:12:59 +0000 (21:12 +0100)]
modify/delete conflict resolution overwrites untracked file

If a file was removed in HEAD, but modified in MERGE_HEAD, recursive merge
will result in a "CONFLICT (delete/modify)". If the (now untracked) file
already exists and was not added to the index, it is overwritten with the
conflict resolution contents.

In similar situations (cf. test 2), the merge would abort with

"error: Untracked working tree 'file' would be overwritten by merge."

The same should happen in this case.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agopager: do not dup2 stderr if it is already redirected
Junio C Hamano [Mon, 15 Dec 2008 08:33:34 +0000 (00:33 -0800)]
pager: do not dup2 stderr if it is already redirected

An earlier commit 61b8050 (sending errors to stdout under $PAGER,
2008-02-16) avoided losing the error messages that are sent to the
standard error when $PAGER is in effect by dup2'ing fd 2 to the pager.
his way, showing a tag object that points to a bad object:

    $ git show tag-foo

would give the error message to the pager.  However, it was not quite
right if the user did:

    $ git show 2>error.log tag-foo

i.e. use the pager but store the errors in a separate file.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-show: do not segfault when showing a bad tag
Junio C Hamano [Mon, 15 Dec 2008 08:36:56 +0000 (00:36 -0800)]
git-show: do not segfault when showing a bad tag

When a tag points at a bad or nonexistent object, we should diagnose the
breakage and exit.  An earlier commit 4f3dcc2 (Fix 'git show' on signed
tag of signed tag of commit, 2008-07-01) lost this check and made it
segfault instead; not good.

This fixes it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoGet rid of the last remnants of GIT_CONFIG_LOCAL v1.6.1-rc3
Johannes Schindelin [Sun, 14 Dec 2008 22:10:52 +0000 (23:10 +0100)]
Get rid of the last remnants of GIT_CONFIG_LOCAL

In dc871831(Only use GIT_CONFIG in "git config", not other programs),
GIT_CONFIG_LOCAL was rested in peace, in favor of not reading
/etc/gitconfig and $HOME/.gitconfig at all when GIT_CONFIG is set.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: Describe git-gui Tools menu configuration options.
Alexander Gavrilov [Sun, 14 Dec 2008 19:44:32 +0000 (22:44 +0300)]
Documentation: Describe git-gui Tools menu configuration options.

Now git gui has a customizable Tools menu, so this adds
information about variables that are used to configure it.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-fast-import possible memory corruption problem
YONETANI Tomokazu [Sun, 14 Dec 2008 02:08:22 +0000 (11:08 +0900)]
git-fast-import possible memory corruption problem

Internal "allocate in bulk, we will never free this memory anyway"
allocator used in fast-import had a logic to round up the size of the
requested memory block in a wrong place (it computed if the available
space is enough to fit the request first, and then carved a chunk of
memory by size rounded up to the alignment, which could go beyond the
actually available space).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agopack-objects: don't use too many threads with few objects
Nicolas Pitre [Sat, 13 Dec 2008 20:06:40 +0000 (15:06 -0500)]
pack-objects: don't use too many threads with few objects

If there are few objects to deltify, they might be split amongst threads
so that there is simply no other objects left to delta against within
the same thread.  Let's use the same 2*window treshold as used for the
final load balancing to allow extra threads to be created.

This fixes the benign t5300 test failure.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Tested-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobuiltin-commit: remove unused message variable
Markus Heidelberg [Sat, 13 Dec 2008 19:05:34 +0000 (20:05 +0100)]
builtin-commit: remove unused message variable

builtin-commit uses commit_tree() from builtin-commit-tree since
6bb6b03 (builtin-commit: use commit_tree(), 2008-09-10), where the
same message is used.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Sat, 13 Dec 2008 05:50:34 +0000 (21:50 -0800)]
Merge branch 'maint'

* maint:
  git-config.txt: fix a typo

15 years agomergetool: Don't keep temporary merge files unless told to
Charles Bailey [Fri, 12 Dec 2008 21:48:41 +0000 (21:48 +0000)]
mergetool: Don't keep temporary merge files unless told to

This changes git mergetool to remove the temporary files used to invoke
the merge tool even if it returns non-zero.

This also adds a configuration option (mergetool.keepTemporaries) to
retain the previous behaviour if desired.

Signed-off-by: Charles Bailey <charles@hashpling.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agomergetool: Add prompt to continue after failing to merge a file
Charles Bailey [Fri, 12 Dec 2008 21:48:40 +0000 (21:48 +0000)]
mergetool: Add prompt to continue after failing to merge a file

This option stops git mergetool from aborting at the first failed merge.
After a failed merge the user will be prompted to indicated whether he
wishes to continue with attempting to merge subsequent paths or to
abort.

This allows some additional use patterns. Merge conflicts can now be
previewed one at time and merges can also be skipped so that they can be
performed in a later pass.

Signed-off-by: Charles Bailey <charles@hashpling.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-branch: display sha1 on branch deletion
Brandon Casey [Fri, 12 Dec 2008 23:20:07 +0000 (17:20 -0600)]
git-branch: display sha1 on branch deletion

Make it easier to recover from a mistaken branch deletion by displaying the
sha1 of the branch's tip commit.

Update t3200 test to match the change in output.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-config.txt: fix a typo
Jim Meyering [Fri, 12 Dec 2008 09:00:41 +0000 (10:00 +0100)]
git-config.txt: fix a typo

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoautodetect number of CPUs by default when using threads
Nicolas Pitre [Thu, 11 Dec 2008 20:36:47 +0000 (15:36 -0500)]
autodetect number of CPUs by default when using threads

... and display the actual number of threads used when locally
repacking.  A remote server still won't tell you how many threads it
uses during a fetch though.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Thu, 11 Dec 2008 08:36:31 +0000 (00:36 -0800)]
Merge branch 'maint'

* maint:
  fsck: reduce stack footprint
  make sure packs to be replaced are closed beforehand

15 years agofsck: reduce stack footprint
Linus Torvalds [Thu, 11 Dec 2008 03:44:37 +0000 (19:44 -0800)]
fsck: reduce stack footprint

The logic to mark all objects that are reachable from tips of refs were
implemented as a set of recursive functions.  In a repository with a deep
enough history, this can easily eat up all the available stack space.

Restructure the code to require less stackspace by using an object array
to keep track of the objects that still need to be processed.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb: cache $parent_commit info in git_blame()
Jakub Narebski [Thu, 11 Dec 2008 00:33:29 +0000 (01:33 +0100)]
gitweb: cache $parent_commit info in git_blame()

Luben Tuikov changed 'lineno' link from leading to commit which gave
current version of given block of lines, to leading to parent of this
commit in 244a70e (Blame "linenr" link jumps to previous state at
"orig_lineno").  This made possible data mining using 'blame' view.

The current implementation calls rev-parse once per each blamed line
to find parent revision of blamed commit, even when the same commit
appears more than once, which is inefficient.

This patch mitigates this issue by caching $parent_commit info in
%metainfo, which makes gitweb call rev-parse only once per each
unique commit in the output from "git blame".

In the tables below you can see simple benchmark comparing gitweb
performance before and after this patch

File               | L[1] | C[2] || Time0[3] | Before[4] | After[4]
====================================================================
blob.h             |   18 |    4 || 0m1.727s |  0m2.545s |  0m2.474s
GIT-VERSION-GEN    |   42 |   13 || 0m2.165s |  0m2.448s |  0m2.071s
README             |   46 |    6 || 0m1.593s |  0m2.727s |  0m2.242s
revision.c         | 1923 |  121 || 0m2.357s | 0m30.365s |  0m7.028s
gitweb/gitweb.perl | 6291 |  428 || 0m8.080s | 1m37.244s | 0m20.627s

File               | L/C  | Before/After
=========================================
blob.h             |  4.5 |         1.03
GIT-VERSION-GEN    |  3.2 |         1.18
README             |  7.7 |         1.22
revision.c         | 15.9 |         4.32
gitweb/gitweb.perl | 14.7 |         4.71

As you can see the greater ratio of lines in file to unique commits
in blame output, the greater gain from the new implementation.

  Legend:

  [1] Number of lines:
      $ wc -l <file>
  [2] Number of unique commits in the blame output:
      $ git blame -p <file> | grep author-time | wc -l
  [3] Time for running "git blame -p" (user time, single run):
      $ time git blame -p <file> >/dev/null
  [4] Time to run gitweb as Perl script from command line:
      $ gitweb-run.sh "p=.git;a=blame;f=<file>" > /dev/null 2>&1

The gitweb-run.sh script includes slightly modified (with adjusted
pathnames) code from gitweb_run() function from the test script
t/t9500-gitweb-standalone-no-errors.sh; gitweb config file
gitweb_config.perl contents (again up to adjusting pathnames; in
particular $projectroot variable should point to top directory of git
repository) can be found in the same place.

Discussion
~~~~~~~~~~

A possible future improvement would be to open a bidi pipe to
"git cat-file --batch-check", (like in Git::Repo in gitweb caching by
Lea Wiemann), feed $long_rev^ to it, and parse its output, which is
in the following form:

  926b07e694599d86cec668475071b32147c95034 commit 637

This would mean one call to git-cat-file for the whole 'blame' view,
instead of one call to git-rev-parse per each unique commit in blame
output.

Yet another solution would be to change use of validate_refname() to
validate_revision() when checking script parameters (CGI query or
path_info), with validate_revision being something like the following:

  sub validate_revision {
        my $rev = shift;
        return validate_refname(strip_rev_suffixes($rev));
  }

so we don't need to calculate $long_rev^, but can pass "$long_rev^" as
'hb' parameter.

This solution has the advantage that it can be easily adapted to future
incremental blame output.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAdd support for a pdf version of the user manual
Miklos Vajna [Wed, 10 Dec 2008 22:44:50 +0000 (23:44 +0100)]
Add support for a pdf version of the user manual

Use dblatex in order to create a pdf version of the git user manual.  No
existing Makefile targets (including "all") are touched, so you need to
explicitly say

make pdf
sudo make install-pdf

to get user-manual.pdf created and installed.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>