Code

git.git
16 years agoStart moving unpack-trees to "struct tree_desc"
Linus Torvalds [Fri, 10 Aug 2007 05:21:29 +0000 (22:21 -0700)]
Start moving unpack-trees to "struct tree_desc"

This doesn't actually change any real code, but it changes the interface
to unpack_trees() to take an array of "struct tree_desc" entries, the same
way the tree-walk.c functions do.

The reason for this is that we would be much better off if we can do the
tree-unpacking using the generic "traverse_trees()" functionality instead
of having to the special "unpack" infrastructure.

This really is a pretty minimal diff, just to change the calling
convention. It passes all the tests, and looks sane. There were only two
users of "unpack_trees()": builtin-read-tree and merge-recursive, and I
tried to keep the changes minimal.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoReinstate the old behaviour when GIT_DIR is set and GIT_WORK_TREE is unset
Johannes Schindelin [Sun, 5 Aug 2007 13:12:53 +0000 (14:12 +0100)]
Reinstate the old behaviour when GIT_DIR is set and GIT_WORK_TREE is unset

The old behaviour was to unilaterally default to the cwd is the work tree
when GIT_DIR was set, but GIT_WORK_TREE wasn't, no matter if we are inside
the GIT_DIR, or if GIT_DIR is actually something like ../../../.git.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agotweak manpage formatting
Junio C Hamano [Fri, 10 Aug 2007 07:49:26 +0000 (00:49 -0700)]
tweak manpage formatting

This attempts to force fixed-font in manpages for literal
blocks.  I have tested this with docbook 1.71 and it seems to
work as expected.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix an illustration in git-rev-parse.txt
Junio C Hamano [Fri, 10 Aug 2007 07:49:27 +0000 (00:49 -0700)]
Fix an illustration in git-rev-parse.txt

This hides the backslash at the end of line from AsciiDoc
toolchain by introducing a trailing whitespace on one line in an
illustration in git-rev-parse.txt.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agosend-email: get all the quoting of realnames right
Uwe Kleine-König [Thu, 9 Aug 2007 13:27:58 +0000 (15:27 +0200)]
send-email: get all the quoting of realnames right

- when sending several mails I got a slightly different behaviour for the first
  mail compared to the second to last one.  The reason is that $from was
  assigned in line 608 and was not reset when beginning to handle the next
  mail.

- Email::Valid can only handle properly quoted real names, so quote arguments
  to extract_valid_address.

This patch cleans up variable naming to better differentiate between sender of
the mail and it's author.

Signed-off-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agosend-email: rfc822 forbids using <address@domain> without a non-empty "phrase"
Uwe Kleine-König [Thu, 9 Aug 2007 13:27:57 +0000 (15:27 +0200)]
send-email: rfc822 forbids using <address@domain> without a non-empty "phrase"

Email::Valid does respect this considering such a mailbox specification
invalid.  b06c6bc831cbb9e9eb82fd3ffd5a2b674cd940d0 addressed the issue, but
only if Email::Valid is available.

Signed-off-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoUse the empty tree for base diff in paranoid-update on new branches
Shawn O. Pearce [Thu, 9 Aug 2007 06:38:16 +0000 (02:38 -0400)]
Use the empty tree for base diff in paranoid-update on new branches

We have to load a tree difference for the purpose of testing
file patterns.  But if our branch is being created and there is no
specific base to difference against in the rule our base will be
'0'x40.  This is (usually) not a valid tree-ish object in a Git
repository, so there's nothing to difference against.

Instead of creating the empty tree and running git-diff against
that we just take the output of `ls-tree -r --name-only` and mark
every returned pathname as an add.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoTeach the update-paranoid to look at file differences
Shawn O. Pearce [Thu, 9 Aug 2007 06:38:12 +0000 (02:38 -0400)]
Teach the update-paranoid to look at file differences

In some applications of the update hook a user may be allowed to
modify a branch, but only if the file level difference is also an
allowed change.  This is the commonly requested feature of allowing
users to modify only certain files.

A new repository.*.allow syntax permits granting the three basic
file level operations:

  A: file is added relative to the other tree
  M: file exists in both trees, but its SHA-1 or mode differs
  D: file is removed relative to the other tree

on a per-branch and path-name basis.  The user must also have a
branch level allow line already granting them access to create,
rewind or update (CRU) that branch before the hook will consult
any file level rules.

In order for a branch change to succeed _all_ files that differ
relative to some base (by default the old value of this branch,
but it can also be any valid tree-ish) must be allowed by file
level allow rules.  A push is rejected if any diff exists that
is not covered by at least one allow rule.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoTeach update-paranoid how to store ACLs organized by groups
Shawn O. Pearce [Thu, 9 Aug 2007 06:38:09 +0000 (02:38 -0400)]
Teach update-paranoid how to store ACLs organized by groups

In some applications of this paranoid update hook the set of ACL
rules that need to be applied to a user can be large, and the
number of users that those rules must also be applied to can be
more than a handful of individuals.  Rather than repeating the same
rules multiple times (once for each user) we now allow users to be
members of groups, where the group supplies the list of ACL rules.
For various reasons we don't depend on the underlying OS groups
and instead perform our own group handling.

Users can be made a member of one or more groups by setting the
user.memberOf property within the "users/$who.acl" file:

  [user]
    memberOf = developer
memberOf = administrator

This will cause the hook to also parse the "groups/$groupname.acl"
file for each value of user.memberOf, and merge any allow rules
that match the current repository with the user's own private rules
(if they had any).

Since some rules are basically the same but may have a component
differ based on the individual user, any user.* key may be inserted
into a rule using the "${user.foo}" syntax.  The allow rule does
not match if the user does not define one (and exactly one) value
for the key "foo".

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix formatting of git-blame documentation.
Junio C Hamano [Fri, 10 Aug 2007 07:47:28 +0000 (00:47 -0700)]
Fix formatting of git-blame documentation.

blame-options.txt did not format multi-paragraph option description
correctly.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agocvsserver: Fix for work trees
Brian Downing [Thu, 9 Aug 2007 04:26:10 +0000 (23:26 -0500)]
cvsserver: Fix for work trees

git-cvsserver used checkout-index internally for commit and annotate.
Since a work tree is required for this to function now, this was
breaking.  Work around this by defining GIT_WORK_TREE=. in the
appropriate places.

Signed-off-by: Brian Downing <bdowning@lavos.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-p4: Fix git-p4 submit to include only changed files in the perforce submit template.
Simon Hausmann [Wed, 8 Aug 2007 15:06:55 +0000 (17:06 +0200)]
git-p4: Fix git-p4 submit to include only changed files in the perforce submit template.

Parse the files section in the "p4 change -o" output and remove lines with file changes in unrelated depot paths.

Signed-off-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoReorder the list of commands in the manual.
Junio C Hamano [Wed, 8 Aug 2007 20:41:46 +0000 (13:41 -0700)]
Reorder the list of commands in the manual.

The basic idea was proposed by Steve Hoelzer; in order to make
the list easier to search, we keep the command list in the
script that generates it with "sort -d".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-p4: Fix support for symlinks.
Simon Hausmann [Tue, 7 Aug 2007 10:28:00 +0000 (12:28 +0200)]
git-p4: Fix support for symlinks.

Detect symlinks as file type, set the git file mode accordingly and strip off the trailing newline in the p4 print output.
Make the mode handling a bit more readable at the same time.

Signed-off-by: Simon Hausmann <simon@lst.de>
Acked-by: Brian Swetland <swetland@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-stash documentation: add missing backtick
Steve Hoelzer [Tue, 7 Aug 2007 17:38:29 +0000 (12:38 -0500)]
git-stash documentation: add missing backtick

Signed-off-by: Steve Hoelzer <shoelzer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-stash documentation: stash numbering starts at zero, not one
Steve Hoelzer [Tue, 7 Aug 2007 17:39:03 +0000 (12:39 -0500)]
git-stash documentation: stash numbering starts at zero, not one

Signed-off-by: Steve Hoelzer <shoelzer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd a note about the index being updated by git-status in some cases
Steven Grimm [Tue, 7 Aug 2007 05:57:47 +0000 (22:57 -0700)]
Add a note about the index being updated by git-status in some cases

Signed-off-by: Steven Grimm <koreth@midwinter.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation/git-commit.txt: correct bad list formatting.
David Kastrup [Mon, 6 Aug 2007 12:56:32 +0000 (14:56 +0200)]
Documentation/git-commit.txt: correct bad list formatting.

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agosend-email: teach sanitize_address to do rfc2047 quoting
Uwe Kleine-K\e,Av\e(Bnig [Mon, 6 Aug 2007 20:34:50 +0000 (22:34 +0200)]
send-email: teach sanitize_address to do rfc2047 quoting

Without this patch I'm not able to properly send emails as I have a
non-ascii character in my name.

I removed the _rfc822 suffix from the function name as it now does more
than rfc822 quoting.

I dug through rfc822 to do the double quoting right.  Only if that is not
possible rfc2047 quoting is applied.

Signed-off-by: Uwe Kleine-K\e,Av\e(Bnig <ukleinek@informatik.uni-freiburg.de>
Cc: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix "make GZ=1 quick-install-doc"
Junio C Hamano [Tue, 7 Aug 2007 04:15:15 +0000 (21:15 -0700)]
Fix "make GZ=1 quick-install-doc"

The basic idea is from Mark Levedahl.  I do not use GZ=1 nor
quick-install-doc myself (there obviously is a chicken-and-egg
issue with quick-install-doc for me).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agopager: find out pager setting from configuration
Junio C Hamano [Tue, 7 Aug 2007 04:08:43 +0000 (21:08 -0700)]
pager: find out pager setting from configuration

It was very unfortunate that we added core.pager setting to the
configuration file; even when the underlying command does not care
if there is no git repository is involved (think "git diff --no-index"),
the user would now rightfully want the configuration setting to be
honored, which means we would need to read the configuration file before
we launch the pager.

This is a minimum change in the sense that it restores the old
behaviour of not even reading config in setup_git_directory(),
but have the core.pager honored when we know it matters.

Note that this does not cover "git -p --git-dir where command";
the -p option immediately trigger the pager settings before we
even see --git-dir to learn where the configuration file is, so
we will end up reading the configuration from the place where
we would _normally_ find the git repository.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-am: initialize variable $resume on startup
Gerrit Pape [Mon, 6 Aug 2007 14:15:30 +0000 (14:15 +0000)]
git-am: initialize variable $resume on startup

git-am expects the variable $resume to be empty or unset, which might not
be the case if $resume is set in the user's environment.  So initialize
it to an empty value on startup.

The problem was noticed by Pierre Habouzit and reported through
 http://bugs.debian.org/435807

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation/git-svn: how to clone a git-svn-created repository
Adam Roben [Mon, 6 Aug 2007 08:16:43 +0000 (01:16 -0700)]
Documentation/git-svn: how to clone a git-svn-created repository

These instructions tell you how to create a clone of a repository
created with git-svn, that can in turn be used with git-svn.

Signed-off-by: Adam Roben <aroben@apple.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint'
Junio C Hamano [Mon, 6 Aug 2007 08:37:10 +0000 (01:37 -0700)]
Merge branch 'maint'

* maint:
  apply: remove directory that becomes empty by renaming the last file away
  setup.c:verify_non_filename(): don't die unnecessarily while disambiguating

16 years agoapply: remove directory that becomes empty by renaming the last file away
Linus Torvalds [Sun, 5 Aug 2007 04:48:08 +0000 (21:48 -0700)]
apply: remove directory that becomes empty by renaming the last file away

We attempt to remove directory that becomes empty after removal
of a file.  We should do the same when we rename an existing
file away.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agosetup.c:verify_non_filename(): don't die unnecessarily while disambiguating
Junio C Hamano [Mon, 6 Aug 2007 07:20:06 +0000 (00:20 -0700)]
setup.c:verify_non_filename(): don't die unnecessarily while disambiguating

If you have a working tree _file_ "foo", attempt to refer to a
branch "foo/bar" without -- to disambiguate, like this:

$ git log foo/bar

tried to make sure that foo/bar cannot be naming a working tree
file "foo/bar" (in which case we would say "which one do you
want?  A rev or a working tree file?  clarify with -- please").
We run lstat("foo/bar") to check that.  If it does not succeed,
there is no ambiguity.

That is good.  But we also checked the error status for the
lstat() and expected it to fail with ENOENT.  In this particular
case, however, it fails with ENOTDIR.  That should be treated as
"expected error" as well.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agodocumentation: use the word "index" in the git-commit man page
J. Bruce Fields [Mon, 6 Aug 2007 04:34:02 +0000 (00:34 -0400)]
documentation: use the word "index" in the git-commit man page

As with git-add, I think previous updates to the git-commit man page did
indeed help make it more user-friendly.  But I think the banishment of
the word "index" from the description goes too far; reinstate its use,
to simplify some of the language slightly and smooth the transition to
other documentation.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'master' of git://linux-nfs.org/~bfields/git
Junio C Hamano [Mon, 6 Aug 2007 00:55:52 +0000 (17:55 -0700)]
Merge branch 'master' of git://linux-nfs.org/~bfields/git

* 'master' of git://linux-nfs.org/~bfields/git:
  documentation: use the word "index" in the git-add manual page
  user-manual: mention git-gui
  user-manual: mention git stash
  user-manual: update for new default --track behavior

16 years agoMerge branch 'maint'
J. Bruce Fields [Sun, 5 Aug 2007 23:18:39 +0000 (19:18 -0400)]
Merge branch 'maint'

16 years agodocumentation: use the word "index" in the git-add manual page
J. Bruce Fields [Sun, 5 Aug 2007 23:16:09 +0000 (19:16 -0400)]
documentation: use the word "index" in the git-add manual page

It was a neat trick to show that you could introduce the git-add manual
page without using the word "index", and it was certainly an improvement
over the previous man page (which started out "A simple wrapper for
git-update-index to add files to the index...").

But it's possible to use the standard terminology without sacrificing
user-friendliness.  So, rewrite to use the word "index" when
appropriate.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
16 years agouser-manual: mention git-gui
J. Bruce Fields [Sun, 5 Aug 2007 22:12:37 +0000 (18:12 -0400)]
user-manual: mention git-gui

The git gui project seems to be still in early stages, but at a point
where it's worth mentioning as an alternative way of creating commits.

One feature of interest is the ability to manipulate individual diff
hunks.  However, people have found that feature not to be easily
discoverable from the user-interface.  Pending some ui improvements, a
parenthetical hint here may help.

(Thanks to Steffen Prohask and Junio Hamano for suggesting the
language.)

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
16 years agouser-manual: mention git stash
Junio C Hamano [Fri, 3 Aug 2007 22:22:59 +0000 (15:22 -0700)]
user-manual: mention git stash

Mention the git-stash command as a way to temporarily set aside work in
progress.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
16 years agouser-manual: update for new default --track behavior
J. Bruce Fields [Sun, 5 Aug 2007 21:18:52 +0000 (17:18 -0400)]
user-manual: update for new default --track behavior

Update documentation to reflect the --track default.

That change seems to have happened in the 1.5.3 -rc's, so bump the "for
version x.y.z or newer" warning as well.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
16 years agoFix install-doc-quick target
Junio C Hamano [Sun, 5 Aug 2007 06:48:27 +0000 (23:48 -0700)]
Fix install-doc-quick target

The script starts in a subdirectory of the source directory to
muck with a branch whose structure does not have anything to
do with the actual work tree.  Go up to the top to make it clear
that we operate on the whole tree.

It also exported GIT_DIR without any good reason.  Remove it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agounpack-trees.c: assume submodules are clean during check-out
Junio C Hamano [Sat, 4 Aug 2007 05:13:09 +0000 (22:13 -0700)]
unpack-trees.c: assume submodules are clean during check-out

Sven originally raised this issue:

    If you have a submodule checked out and you go back (or
    forward) to a revision of the supermodule that contains a
    different revision of the submodule and then switch to
    another revision, it will complain that the submodule is not
    uptodate, because git simply didn't update the submodule in
    the first move.

The current policy is to consider it is perfectly normal that
checked-out submodule is out-of-sync wrt the supermodule index.
At least until we introduce a superproject repository
configuration option that says "in this repository, I do care
about this submodule and at any time I move around in the
superproject, recursively check out the submodule to match", it
is a reasonable policy, as we currently do not recursively
checkout the submodules at all.  The most extreme case of this
policy is that the superproject index knows about the submodule
but the subdirectory does not even have to be checked out.

The function verify_uptodate(), called during the two-way merge
aka branch switching, is about "make sure the filesystem entity
that corresponds to this cache entry is up to date, lest we lose
the local modifications".  As we explicitly allow submodule
checkout to drift from the supermodule index entry, the check
should say "Ok, for submodules, not matching is the norm" for
now.

Later when we have the ability to mark "I care about this
submodule to be always in sync with the superproject" (thereby
implementing automatic recursive checkout and perhaps diff,
among other things), we should check if the submodule in
question is marked as such and perform the current test.

Acked-by: Lars Hjemli <hjemli@gmail.com>
Acked-by: Sven Verdoolaege <skimo@kotnet.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFixed git-push manpage
Jyotirmoy Bhattacharya [Sun, 5 Aug 2007 05:22:15 +0000 (10:52 +0530)]
Fixed git-push manpage

In git-push it is the remote repository and not the
local repository which is fast forwarded. The description
of the -f option in the git-push manpage gets it the other
way round.

Signed-off-by: Jyotirmoy Bhattacharya <jyotirmoy@jyotirmoy.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agocheckout-index needs a working tree
Johannes Schindelin [Sat, 4 Aug 2007 22:20:07 +0000 (23:20 +0100)]
checkout-index needs a working tree

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoadd "test-absolute-path" to .gitignore
Randal L. Schwartz [Sat, 4 Aug 2007 08:57:29 +0000 (01:57 -0700)]
add "test-absolute-path" to .gitignore

New file requires new ignore.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocument GIT_SSH environment variable alongside other variables
Shawn O. Pearce [Sat, 4 Aug 2007 06:06:52 +0000 (02:06 -0400)]
Document GIT_SSH environment variable alongside other variables

The GIT_SSH environment variable has survived for quite a while
without being documented, but has been mentioned on list and on
my day-job repositories can only be accessed via magic supplied
through the wonderous hack that is GIT_SSH.

Advertising it alongside other "low level magic" such as GIT_PAGER
and GIT_MERGE_VERBOSITY will certainly help others who need to
spread their own pixie dust to make things work.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoINSTALL: add warning on docbook-xsl 1.72 and 1.73
Junio C Hamano [Sat, 4 Aug 2007 03:19:09 +0000 (20:19 -0700)]
INSTALL: add warning on docbook-xsl 1.72 and 1.73

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogitweb: Fix handling of $file_name in feed generation
Jakub Narebski [Fri, 3 Aug 2007 17:50:42 +0000 (19:50 +0200)]
gitweb: Fix handling of $file_name in feed generation

The commit b6093a5c, by Robert Fitzsimons:
  "gitweb: Change atom, rss actions to use parse_commits."
forgot to pass $file_name parameter to parse_commits subroutine.

If git_feed is provided a file name, it ought to show only the history
affecting that file or a directory.  The title was being set
correctly, but all commits from history were being shown.

Signed-off-by: Steven Walter <stevenrwalter@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-completion: add "git stash"
Junio C Hamano [Fri, 3 Aug 2007 09:04:37 +0000 (02:04 -0700)]
git-completion: add "git stash"

This is a new addition to 1.5.3; let's teach it to the
completion before the final release.

[sp: Added missing git-stash completion configuration]

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Added support for OS X right click gitgui-0.8.1
Väinö Järvelä [Fri, 3 Aug 2007 09:27:39 +0000 (12:27 +0300)]
git-gui: Added support for OS X right click

OS X sends Button-2 on a "real" right click, such as with a three
button mouse, or by using the two-finger trackpad click.

Signed-off-by: Väinö Järvelä <v@pp.inet.fi>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agoGIT 1.5.3-rc4 v1.5.3-rc4
Junio C Hamano [Fri, 3 Aug 2007 22:33:57 +0000 (15:33 -0700)]
GIT 1.5.3-rc4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix bogus use of printf in t3700 test
Junio C Hamano [Fri, 3 Aug 2007 21:31:47 +0000 (14:31 -0700)]
Fix bogus use of printf in t3700 test

The hashed contents did not matter in the end result, but it passed
an uninitialized variable to printf, which caused it to emit empty
while giving an error/usage message.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogitweb: do not choke on recursive symlink
Junio C Hamano [Fri, 27 Jul 2007 08:23:03 +0000 (01:23 -0700)]
gitweb: do not choke on recursive symlink

If somebody used to advertise his repository that physically
resides at /pub/lic.git/ as:

git://git.example.com/pub/lic.git/

but now wants to use --base-path to allow:

git://git.example.com/lic.git/

she can start git-daemon with --base-path option, like this:

git-daemon --base-path=/pub --export-all

During the transition, however, she would also want to allow
older URL as well.  One natural way to achieve that is to create
a symlink:

ln -s /pub /pub/pub

so that a request to git://git.example.com/pub/lic.git/ is first
translated by --base-path to a request to /pub/pub/lic.git/
which goes to /pub/lic.git, thanks to the symlink.

So far so good.

However, gitweb chokes if there is such a symlink (File::Find
barfs with "/pub/pub is a recursive symbolic link").  Make the
code ignore such a symlink.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-gui: Avoid Tcl error in popup menu on diff viewer
Shawn O. Pearce [Fri, 3 Aug 2007 02:55:22 +0000 (22:55 -0400)]
git-gui: Avoid Tcl error in popup menu on diff viewer

If there is no path currently shown in the diff viewer then we
were getting Tcl errors anytime the user right-clicked on the
diff viewer to bring up its popup menu.  The bug here is caused
by trying to get the file_state for the empty string; this path
is never seen so we never have file_state for it.  In such cases
we now disable the Stage Hunk For Commit option.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agoFix work-tree related breakages
Junio C Hamano [Thu, 2 Aug 2007 22:10:56 +0000 (15:10 -0700)]
Fix work-tree related breakages

In set_work_tree(), variable rel needs to be reinitialized to
NULL on every call (it should not be static).

Make sure the incoming dir variable is not too long before
copying to the temporary buffer, and make sure chdir to the
resulting directory succeeds.

This was spotted and fixed by Alex and Johannes in a handful
patch exchanges.  Here is the final version.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
16 years agoFix documentation for core.gitproxy to reflect code
David Symonds [Thu, 2 Aug 2007 22:45:56 +0000 (08:45 +1000)]
Fix documentation for core.gitproxy to reflect code

The current implementation of core.gitproxy only operates on
git:// URLs, so the ssh:// examples and custom protocol examples
have been removed or edited.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoread-tree: remove unnecessary call to setup_git_directory()
Johannes Schindelin [Thu, 2 Aug 2007 21:36:37 +0000 (22:36 +0100)]
read-tree: remove unnecessary call to setup_git_directory()

read-tree is already marked with RUN_SETUP in git.c, so there is
no need to call setup_git_directory() a second time.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoSupport building on GNU/Hurd
Thomas Schwinge [Thu, 2 Aug 2007 08:56:42 +0000 (10:56 +0200)]
Support building on GNU/Hurd

GNU/Hurd systems don't have strlcpy.

Signed-off-by: Thomas Schwinge <tschwinge@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix style nit in Python slicing.
Han-Wen Nienhuys [Mon, 23 Jul 2007 22:56:37 +0000 (15:56 -0700)]
Fix style nit in Python slicing.

Python slices start at 0 by default.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Simon Hausmann <simon@lst.de>
16 years agoSort output of "p4 change" in incremental import before further
Han-Wen Nienhuys [Mon, 23 Jul 2007 22:51:49 +0000 (15:51 -0700)]
Sort output of "p4 change" in incremental import before further

processing

P4 change outputs the changes sorted for each directory separately. We
want the global ordering on the changes, hence we sort.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Simon Hausmann <simon@lst.de>
16 years agoRelNotes 1.5.3 updates before -rc4
Junio C Hamano [Thu, 2 Aug 2007 07:13:03 +0000 (00:13 -0700)]
RelNotes 1.5.3 updates before -rc4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-clone: aggressively optimize local clone behaviour.
Junio C Hamano [Thu, 2 Aug 2007 06:42:36 +0000 (23:42 -0700)]
git-clone: aggressively optimize local clone behaviour.

This changes the behaviour of cloning from a repository on the
local machine, by defaulting to "-l" (use hardlinks to share
files under .git/objects) and making "-l" a no-op.  A new
option, --no-hardlinks, is also added to cause file-level copy
of files under .git/objects while still avoiding the normal
"pack to pipe, then receive and index pack" network transfer
overhead.  The old behaviour of local cloning without -l nor -s
is availble by specifying the source repository with the newly
introduced file:///path/to/repo.git/ syntax (i.e. "same as
network" cloning).

 * With --no-hardlinks (i.e. have all .git/objects/ copied via
   cpio) would not catch the source repository corruption, and
   also risks corrupted recipient repository if an
   alpha-particle hits memory cell while indexing and resolving
   deltas.  As long as the recipient is created uncorrupted, you
   have a good back-up.

 * same-as-network is expensive, but it would catch the breakage
   of the source repository.  It still risks corrupted recipient
   repository due to hardware failure.  As long as the recipient
   is created uncorrupted, you have a good back-up.

 * The new default on the same filesystem, as long as the source
   repository is healthy, it is very likely that the recipient
   would be, too.  Also it is very cheap.  You do not get any
   back-up benefit, though.

None of the method is resilient against the source repository
corruption, so let's discount that from the comparison.  Then
the difference with and without --no-hardlinks matters primarily
if you value the back-up benefit or not.  If you want to use the
cloned repository as a back-up, then it is cheaper to do a clone
with --no-hardlinks and two git-fsck (source before clone,
recipient after clone) than same-as-network clone, especially as
you are likely to do a git-fsck on the recipient if you are so
paranoid anyway.

Which leads me to believe that being able to use file:/// is
probably a good idea, if only for testability, but probably of
little practical value.  We default to hardlinked clone for
everyday use, and paranoids can use --no-hardlinks as a way to
make a back-up.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoconnect: accept file:// URL scheme
Linus Torvalds [Wed, 1 Aug 2007 17:03:37 +0000 (10:03 -0700)]
connect: accept file:// URL scheme

We might make it something like: "if you use an url, we don't default to
local", so the difference would be that

git clone file:///directory/to/repo

would work the way it does now, but

git clone /directory/to/repo

would default to "-l" behaviour. That kind of would make sense (and should
be easy to implement.

This adds support for "file://" URL to underlying connect
codepath to make it happen.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoWhen generating manpages, delete outdated targets first.
David Kastrup [Wed, 1 Aug 2007 23:48:44 +0000 (01:48 +0200)]
When generating manpages, delete outdated targets first.

This makes "make doc" work even if you made "sudo make doc" previously
by mistake.  Apparently an oversight: the other targets did this already.

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorebase -i: fix for optional [branch] parameter
Johannes Schindelin [Wed, 1 Aug 2007 22:31:03 +0000 (23:31 +0100)]
rebase -i: fix for optional [branch] parameter

When calling "git rebase -i <upstream> <branch>", git should switch
to <branch> first.  This worked before, but I broke it by my
"Shut git rebase -i up" patch.

Fix that, and add a test to make sure that it does not break again.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoTry to be consistent with capitalization in the documentation
Steve Hoelzer [Wed, 1 Aug 2007 15:43:06 +0000 (10:43 -0500)]
Try to be consistent with capitalization in the documentation

Signed-off-by: Steve Hoelzer <shoelzer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-commit.sh: Permit the --amend message to be given with -m/-c/-C/-F.
Junio C Hamano [Thu, 2 Aug 2007 01:14:41 +0000 (18:14 -0700)]
git-commit.sh: Permit the --amend message to be given with -m/-c/-C/-F.

[jc: adjusted t/t7501 as this makes -F and --amend compatible]

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-sh-setup.sh: make GIT_EDITOR/core.editor/VISUAL/EDITOR accept commands
David Kastrup [Wed, 1 Aug 2007 21:47:20 +0000 (23:47 +0200)]
git-sh-setup.sh: make GIT_EDITOR/core.editor/VISUAL/EDITOR accept commands

The previous code only allowed specifying a single executable rather
than a complete command like "emacsclient --alternate-editor vi" in
those variables.  Since VISUAL/EDITOR appear to be traditionally
passed to a shell for interpretation (as corroborated with "less",
"mail" and "mailx", while the really ancient "more" indeed allows only
an executable name), the shell function git_editor has been amended
appropriately.

"eval" is employed to have quotes and similar interpreted _after_
expansion, so that specifying
EDITOR='"/home/dak/My Commands/notepad.exe"'
can be used for actually using commands with blanks.

Instead of passing just the first argument of git_editor on, we pass
all of them (so that +lineno might be employed at a later point of
time, or so that multiple files may be edited when appropriate).

Strictly speaking, there is a change in behavior: when
git config core.editor
returns a valid but empty string, the fallbacks are still searched.
This is more consistent, and the old code was problematic with regard
to multiple blanks.  Putting in additional quotes might have worked,
but quotes inside of command substitution inside of quotes is nasty
enough to not reliably work the same across "Bourne shells".

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoHack git-add--interactive to make it work with ActiveState Perl
Alex Riesen [Wed, 1 Aug 2007 12:57:43 +0000 (14:57 +0200)]
Hack git-add--interactive to make it work with ActiveState Perl

It wont work for arguments with special characters (like ", : or *).
It is generally not possible on Windows, so I didn't even try.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorebase -i: ignore patches that are already in the upstream
Johannes Schindelin [Wed, 1 Aug 2007 14:59:35 +0000 (15:59 +0100)]
rebase -i: ignore patches that are already in the upstream

Non-interactive rebase had this from the beginning -- match it by
using --cherry-pick option to rev-list.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoget_relative_cwd(): clarify why it handles dir == NULL
Johannes Schindelin [Wed, 1 Aug 2007 18:26:59 +0000 (19:26 +0100)]
get_relative_cwd(): clarify why it handles dir == NULL

The comment did not make a good case why it makes sense.
Clarify, and remove stale comment about the caller being lazy.
The behaviour on NULL input is pretty much intentional.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoClean up work-tree handling
Johannes Schindelin [Wed, 1 Aug 2007 00:30:14 +0000 (01:30 +0100)]
Clean up work-tree handling

The old version of work-tree support was an unholy mess, barely readable,
and not to the point.

For example, why do you have to provide a worktree, when it is not used?
As in "git status".  Now it works.

Another riddle was: if you can have work trees inside the git dir, why
are some programs complaining that they need a work tree?

IOW it is allowed to call

$ git --git-dir=../ --work-tree=. bla

when you really want to.  In this case, you are both in the git directory
and in the working tree.  So, programs have to actually test for the right
thing, namely if they are inside a working tree, and not if they are
inside a git directory.

Also, GIT_DIR=../.git should behave the same as if no GIT_DIR was
specified, unless there is a repository in the current working directory.
It does now.

The logic to determine if a repository is bare, or has a work tree
(tertium non datur), is this:

--work-tree=bla overrides GIT_WORK_TREE, which overrides core.bare = true,
which overrides core.worktree, which overrides GIT_DIR/.. when GIT_DIR
ends in /.git, which overrides the directory in which .git/ was found.

In related news, a long standing bug was fixed: when in .git/bla/x.git/,
which is a bare repository, git formerly assumed ../.. to be the
appropriate git dir.  This problem was reported by Shawn Pearce to have
caused much pain, where a colleague mistakenly ran "git init" in "/" a
long time ago, and bare repositories just would not work.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd set_git_dir() function
Johannes Schindelin [Wed, 1 Aug 2007 00:29:38 +0000 (01:29 +0100)]
Add set_git_dir() function

With the function set_git_dir() you can reset the path that will
be used for git_path(), git_dir() and friends.

The responsibility to close files and throw away information from the
old git_dir lies with the caller.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd functions get_relative_cwd() and is_inside_dir()
Johannes Schindelin [Wed, 1 Aug 2007 00:29:17 +0000 (01:29 +0100)]
Add functions get_relative_cwd() and is_inside_dir()

The function get_relative_cwd() works just as getcwd(), only that it
takes an absolute path as additional parameter, returning the prefix
of the current working directory relative to the given path.  If the
cwd is no subdirectory of the given path, it returns NULL.

is_inside_dir() is just a trivial wrapper over get_relative_cwd().

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd is_absolute_path() and make_absolute_path()
Johannes Schindelin [Wed, 1 Aug 2007 00:28:59 +0000 (01:28 +0100)]
Add is_absolute_path() and make_absolute_path()

This patch adds convenience functions to work with absolute paths.
The function is_absolute_path() should help the efforts to integrate
the MinGW fork.

Note that make_absolute_path() returns a pointer to a static buffer.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years ago--base-path-relaxed option
Jens Axboe [Fri, 27 Jul 2007 21:00:29 +0000 (14:00 -0700)]
--base-path-relaxed option

I switched git.kernel.dk to --base-path a few minutes ago, to get rid of
a /data/git postfix in the posted urls. But transitioning is tricky,
since now all old paths will fail miserably.

So I added this --base-path-relaxed option, that will make git-daemon
try the absolute path without prefixing --base-path before giving up.
With this in place and --base-path-relaxed added, both my new url of

    git://git.kernel.dk/linux-2.6-block.git

and the old

    git://git.kernel.dk/data/git/linux-2.6-block.git

work fine.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd test case for basic commit functionality.
Kristian Høgsberg [Tue, 31 Jul 2007 19:37:30 +0000 (15:37 -0400)]
Add test case for basic commit functionality.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit.el: Take into account the core.excludesfile config option.
Alexandre Julliard [Tue, 31 Jul 2007 10:36:32 +0000 (12:36 +0200)]
git.el: Take into account the core.excludesfile config option.

Also don't require .git/info/exclude to exist in order to list unknown
files.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Acked-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit.el: Avoid using ewoc-set-data for compatibility with Emacs 21.
Alexandre Julliard [Wed, 1 Aug 2007 06:03:41 +0000 (23:03 -0700)]
git.el: Avoid using ewoc-set-data for compatibility with Emacs 21.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Acked-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMake verse of git-config manpage more readable
Alex Riesen [Tue, 31 Jul 2007 22:01:17 +0000 (00:01 +0200)]
Make verse of git-config manpage more readable

Also mention '--file' in FILES.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd a test for git-config --file
Alex Riesen [Tue, 31 Jul 2007 10:30:52 +0000 (12:30 +0200)]
Add a test for git-config --file

Check for non-0 exit code if the confiog file does not exist and
if it works exactly like when setting GIT_CONFIG.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd an option to specify a file to config builtin
Alex Riesen [Tue, 31 Jul 2007 09:58:43 +0000 (11:58 +0200)]
Add an option to specify a file to config builtin

There are (really!) systems where using environment variables is very
cumbersome (yes, Windows, it has problems unsetting them). Besides this
form is shorter.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agomake the name of the library directory a config option
Robert Schiele [Wed, 1 Aug 2007 04:30:35 +0000 (06:30 +0200)]
make the name of the library directory a config option

Introduce new makefile variable lib to hold the name of the lib
directory ("lib" by default).  Also introduce a switch for configure
to specify this name with --with-lib=ARG.  This is useful for systems
that use a different name than "lib" (like "lib64" on some 64 bit
Linux architectures).

Signed-off-by: Robert Schiele <rschiele@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint'
Junio C Hamano [Wed, 1 Aug 2007 04:12:32 +0000 (21:12 -0700)]
Merge branch 'maint'

* maint:
  rev-list --bisect: fix allocation of "int*" instead of "int".

16 years agorev-list --bisect: fix allocation of "int*" instead of "int".
Christian Couder [Tue, 31 Jul 2007 12:48:29 +0000 (14:48 +0200)]
rev-list --bisect: fix allocation of "int*" instead of "int".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit.c: execution path
Junio C Hamano [Tue, 31 Jul 2007 09:06:14 +0000 (02:06 -0700)]
git.c: execution path

The comment before executing git subcommands were stale and confusing.
Noticed by Jeff King.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoadd option to find zlib in custom path
Robert Schiele [Sun, 29 Jul 2007 18:35:45 +0000 (20:35 +0200)]
add option to find zlib in custom path

Some systems do not provide zlib development headers and libraries in
default search path of the compiler.  For these systems we should allow
specifying the location by --with-zlib=PATH or by setting ZLIB_PATH in
the makefile.

Signed-off-by: Robert Schiele <rschiele@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoUnset GIT_EDITOR while running tests.
Junio C Hamano [Tue, 31 Jul 2007 05:16:40 +0000 (22:16 -0700)]
Unset GIT_EDITOR while running tests.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoadd_file_to_index: skip rehashing if the cached stat already matches
Junio C Hamano [Tue, 31 Jul 2007 00:12:58 +0000 (17:12 -0700)]
add_file_to_index: skip rehashing if the cached stat already matches

An earlier commit 366bfcb6 broke git-add by moving read_cache()
call down, because it wanted the directory walking code to grab
paths that are already in the index.  The change serves its
purpose, but introduces a regression because the responsibility
of avoiding unnecessary reindexing by matching the cached stat
is shifted nowhere.

This makes it the job of add_file_to_index() function.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-svn: Translate invalid characters in refname
Robert Ewald [Mon, 30 Jul 2007 09:08:21 +0000 (11:08 +0200)]
git-svn: Translate invalid characters in refname

In git some characters are invalid as documented
in git-check-ref-format. In subversion these characters might
be valid, so a translation is required.

This patch does this translation by url escaping characters, that
are not allowed.

Credit goes to Eric Wong, martin f. krafft and Jan Hudec

Signed-off-by: Robert Ewald <robewald@gmx.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agowhite space fixes in setup.c
Johannes Schindelin [Sun, 29 Jul 2007 23:24:38 +0000 (00:24 +0100)]
white space fixes in setup.c

Some lines were not indented by tabs but by spaces.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation/gitattributes.txt: typofix
David Soria Parra [Mon, 30 Jul 2007 01:50:24 +0000 (22:50 -0300)]
Documentation/gitattributes.txt: typofix

The file used for per-repository attribute setting is not
$GIT_DIR/info/gitattributes, but $GIT_DIR/info/attributes.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorebase: try not to munge commit log message
Junio C Hamano [Sun, 29 Jul 2007 00:57:25 +0000 (17:57 -0700)]
rebase: try not to munge commit log message

This makes rebase/am keep the original commit log message
better, even when it does not conform to "single line paragraph
to say what it does, then explain and defend why it is a good
change in later paragraphs" convention.

This change is a two-edged sword.  While the earlier behaviour
would make such commit log messages more friendly to readers who
expect to get the birds-eye view with oneline summary formats,
users who primarily use git as a way to interact with foreign
SCM systems would not care much about the convenience of oneline
git log tools, but care more about preserving their own
convention.  This changes their commits less useful to readers
who read them with git tools while keeping them more consistent
with the foreign SCM systems they interact with.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agosymbolic-ref, update-ref: do not refuse reflog message with LF
Junio C Hamano [Sun, 29 Jul 2007 00:20:52 +0000 (17:20 -0700)]
symbolic-ref, update-ref: do not refuse reflog message with LF

Earlier these tools refused to create a reflog entry when the
message given by the calling Porcelain had a LF in it, partially
to keep the file format integrity of reflog file, which is
one-entry-per-line.  These tools should not be dictating such a
policy.

Instead, let the codepath to write out the reflog entry worry
about the format integrity and allow messages with LF in them.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agolog_ref_write() -- do not chomp reflog message at the first LF
Junio C Hamano [Sun, 29 Jul 2007 00:17:17 +0000 (17:17 -0700)]
log_ref_write() -- do not chomp reflog message at the first LF

A reflog file is organized as one-line-per-entry records, and we
enforced the file format integrity by chomping the given message
at the first LF.  This changes it to convert them to SP, which
is more in line with the --pretty=oneline format.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'bs/lock'
Junio C Hamano [Mon, 30 Jul 2007 06:09:54 +0000 (23:09 -0700)]
Merge branch 'bs/lock'

* bs/lock:
  Add test for symlinked configuration file updates.
  use lockfile.c routines in git_commit_set_multivar()
  fully resolve symlinks when creating lockfiles

16 years agoMerge branch 'master' of git://repo.or.cz/git-gui
Junio C Hamano [Mon, 30 Jul 2007 05:53:33 +0000 (22:53 -0700)]
Merge branch 'master' of git://repo.or.cz/git-gui

* 'master' of git://repo.or.cz/git-gui: (50 commits)
  git-gui: Minor refactoring of merge command line in merge support
  git-gui: Use more modern looking icons in the tree browser
  git-gui: Don't offer to stage hunks from untracked files
  git-gui: Make sure remotes are loaded when picking revisions
  git-gui: Use progress bar while resetting/aborting files
  git-gui: Honor core.excludesfile when listing extra files
  git-gui: Unify wording to say "to stage" instead of "to add"
  git-gui: Don't kill modified commit message buffer with merge templates
  git-gui: Remove usernames from absolute SSH urls during merging
  git-gui: Format tracking branch merges as though they were pulls
  git-gui: Cleanup bindings within merge dialog
  git-gui: Replace merge dialog with our revision picker widget
  git-gui: Show ref last update times in revision chooser tooltips
  git-gui: Display commit/tag/remote info in tooltip of revision picker
  git-gui: Save remote urls obtained from config/remotes setup
  git-gui: Avoid unnecessary symbolic-ref call during checkout
  git-gui: Refactor current branch menu items to make i18n easier
  git-gui: Refactor diff popup into a procedure to ease i18n work
  git-gui: Paper bag fix quitting crash after commit
  git-gui: Clarify meaning of add tracked menu option
  ...

16 years agogit-gui: Minor refactoring of merge command line in merge support gitgui-0.8.0
Shawn O. Pearce [Mon, 30 Jul 2007 00:21:54 +0000 (20:21 -0400)]
git-gui: Minor refactoring of merge command line in merge support

This is just a small code movement to cleanup how we generate
the command line for a merge.  I'm only doing it to make the
next series of changes slightly more readable.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Use more modern looking icons in the tree browser
Shawn O. Pearce [Mon, 30 Jul 2007 01:19:54 +0000 (21:19 -0400)]
git-gui: Use more modern looking icons in the tree browser

This is a replacement of all of the icons in our tree browser
window, as the prior icons just looked too 1980s Tk-ish.  The
icons used here are actually from a KDE themed look, so they
might actually be familiar to some users of git-gui.

Aside from using more modern looking icons we now have a special
icon for executable blobs, to make them stand out from the normal
non-executable blobs.  We also denote symlinks now with a different
icon, so they stand out from the other types of objects in the tree.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Don't offer to stage hunks from untracked files
Shawn O. Pearce [Mon, 30 Jul 2007 00:29:52 +0000 (20:29 -0400)]
git-gui: Don't offer to stage hunks from untracked files

If the user looks at an untracked file in our diff pane we used
to offer "Stage Hunk For Commit" in the context menu when they
right-clicked in that pane.  The problem is we don't actually
have any diff hunks in untracked files, so there is nothing to
really select for staging.  So we now grey out the menu item,
so the user cannot invoke it and think its broken when it does
not perform any useful action.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Make sure remotes are loaded when picking revisions
Shawn O. Pearce [Mon, 30 Jul 2007 01:26:42 +0000 (21:26 -0400)]
git-gui: Make sure remotes are loaded when picking revisions

If we are started for only a blame/browser/citool run we don't
usually initialize the list of remotes, or determine which refs
are tracking branches and which are local branch heads.  This is
because some of that work is relatively expensive and is usually
not going to be needed if we are started only for a blame, or to
make a single commit.

However by not loading the remote configuration we were crashing
if the user tried to open a browser for another branch through
the Repository menu, as our load_all_heads procedure was unable
to decide which refs/heads/ items were actually local heads.  We
now force all remote configuration data to be loaded if we have
not done so already and we are trying to create a revision mega
widget.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agoMakefile: use $(FIND) instead of find
David Kastrup [Sun, 29 Jul 2007 22:23:28 +0000 (15:23 -0700)]
Makefile: use $(FIND) instead of find

Some people might prefer to be able to specify the find utility to
use.

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-diff: turn on recursion by default
Jeff King [Sun, 29 Jul 2007 09:49:56 +0000 (05:49 -0400)]
git-diff: turn on recursion by default

The tree recursion behavior of git-diff may appear
inconsistent to the user because it depends on the format of
the patch as well as whether one is diffing between trees or
against the index.

Since git-diff is a porcelain wrapper for low-level diff
commands, it makes sense for its behavior to be consistent
no matter what is being diffed.  This patch turns on
recursion in all cases.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-gui: Use progress bar while resetting/aborting files
Shawn O. Pearce [Sun, 29 Jul 2007 08:06:51 +0000 (04:06 -0400)]
git-gui: Use progress bar while resetting/aborting files

Resetting a large number of files on a slow filesystem can take
considerable time, just as switching branches in such a case can
take more than two seconds.  We now take advantage of the progress
meter output by read-tree and show it in the main window status
bar, just like we do during checkout (branch switch).

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Honor core.excludesfile when listing extra files
Shawn O. Pearce [Sun, 29 Jul 2007 07:22:27 +0000 (03:22 -0400)]
git-gui: Honor core.excludesfile when listing extra files

Recent git versions have a git-status that honors the core.excludesfile
configuration option when it reports on untracked files.  Unfortunately
I missed the introduction of this configuration option in the core
porcelain implementation, so it was not reflected here in git-gui.

Found and reported by Lars Noschinski <lars@public.noschinski.de>.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Unify wording to say "to stage" instead of "to add"
Christian Stimming [Sat, 28 Jul 2007 20:17:10 +0000 (22:17 +0200)]
git-gui: Unify wording to say "to stage" instead of "to add"

Also, the warning message when clicking "Reset" is adapted to
the wording "Reset" rather than a confusion "Cancel commit?".

Signed-off-by: Christian Stimming <stimming@tuhh.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agoRename git-rebase interactive buffer: todo => git-rebase-todo
Seth Falcon [Sat, 28 Jul 2007 23:44:40 +0000 (16:44 -0700)]
Rename git-rebase interactive buffer: todo => git-rebase-todo

When using emacsclient or similar, a temporary buffer (file) named
'todo' could cause confusion with a pre-existing buffer of the same
name.

Signed-off-by: Seth Falcon <sethfalcon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>