git.git
18 years agoTeach bash about git log/show/whatchanged options.
Shawn O. Pearce [Mon, 27 Nov 2006 08:42:18 +0000 (03:42 -0500)]
Teach bash about git log/show/whatchanged options.

Typing out options to git log/show/whatchanged can take a while, but
we can easily complete them with bash.  So list the most common ones,
especially --pretty=online|short|medium|... so that users don't need
to type everything out.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoTeach bash how to complete git-rebase.
Shawn O. Pearce [Mon, 27 Nov 2006 08:42:07 +0000 (03:42 -0500)]
Teach bash how to complete git-rebase.

As git-rebase is a popular command bash should know how to complete
reference names and its long options.  We only support completions
which make sense given the current state of the repository, that
way users don't get shown --continue/--skip/--abort on the first
execution.

Also added support for long option --strategy to git-merge, as I
missed that option earlier and just noticed it while implementing
git-rebase.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoTeach bash how to complete git-cherry-pick.
Shawn O. Pearce [Mon, 27 Nov 2006 08:41:59 +0000 (03:41 -0500)]
Teach bash how to complete git-cherry-pick.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoTeach bash how to complete git-format-patch.
Shawn O. Pearce [Mon, 27 Nov 2006 08:41:43 +0000 (03:41 -0500)]
Teach bash how to complete git-format-patch.

Provide completion for currently known long options supported by
git-format-patch as well as the revision list specification argument,
which is generally either a refname or in the form a..b.

Since _git_log was the only code that knew how to complete a..b, but
we want to start adding option support to _git_log also refactor the
a..b completion logic out into its own function.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoAdd current branch in PS1 support to git-completion.bash.
Shawn O. Pearce [Mon, 27 Nov 2006 08:41:28 +0000 (03:41 -0500)]
Add current branch in PS1 support to git-completion.bash.

Many users want to display the current branch name of the current git
repository as part of their PS1 prompt, much as their PS1 prompt might
also display the current working directory name.

We don't force our own PS1 onto the user.  Instead we let them craft
their own PS1 string and offer them the function __git_ps1 which they
can invoke to obtain either "" (when not in a git repository) or
"(%s)" where %s is the name of the current branch, as read from HEAD,
with the leading refs/heads/ removed.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoTeach bash how to complete options for git-name-rev.
Shawn O. Pearce [Mon, 27 Nov 2006 08:41:12 +0000 (03:41 -0500)]
Teach bash how to complete options for git-name-rev.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoHide plumbing/transport commands from bash completion.
Shawn O. Pearce [Mon, 27 Nov 2006 08:41:01 +0000 (03:41 -0500)]
Hide plumbing/transport commands from bash completion.

Users generally are not going to need to invoke plumbing-level commands
from within one line shell commands.  If they are invoking these commands
then it is likely that they are glueing them together into a shell script
to perform an action, in which case bash completion for these commands is
of relatively little use.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoTeach git-completion.bash how to complete git-merge.
Shawn O. Pearce [Mon, 27 Nov 2006 08:40:47 +0000 (03:40 -0500)]
Teach git-completion.bash how to complete git-merge.

Now that git-merge is high-level Porcelain users are going to expect
to be able to use it from the command line, in which case we really
should also be able to complete ref names as parameters.

I'm also including completion support for the merge strategies
that are supported by git-merge.sh, should the user wish to use a
different strategy than their default.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoUpdate documentation to remove incorrect GIT_DIFF_OPTS example.
Sean [Mon, 27 Nov 2006 19:37:43 +0000 (14:37 -0500)]
Update documentation to remove incorrect GIT_DIFF_OPTS example.

Git no longer calls an external diff program to generate patches.
Remove the documentation which suggests that you can pass
arbitrary diff options via the GIT_DIFF_OPTS environment variable.

Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoMerge branch 'js/shortlog'
Junio C Hamano [Mon, 27 Nov 2006 06:51:38 +0000 (22:51 -0800)]
Merge branch 'js/shortlog'

* js/shortlog:
  git-shortlog: make common repository prefix configurable with .mailmap
  git-shortlog: fix common repository prefix abbreviation.
  builtin git-shortlog is broken
  shortlog: fix "-n"
  shortlog: handle email addresses case-insensitively
  shortlog: read mailmap from ./.mailmap again
  shortlog: do not crash on parsing "[PATCH"
  Build in shortlog

18 years agoMerge branch 'jc/push-delete-ref'
Junio C Hamano [Mon, 27 Nov 2006 06:51:17 +0000 (22:51 -0800)]
Merge branch 'jc/push-delete-ref'

* jc/push-delete-ref:
  Allow git push to delete remote ref.

18 years agoMerge branch 'jc/merge'
Junio C Hamano [Mon, 27 Nov 2006 06:19:56 +0000 (22:19 -0800)]
Merge branch 'jc/merge'

* branch 'jc/merge':
  git-merge: do not leak rev-parse output used for checking internally.
  git-merge: tighten error checking.
  merge: allow merging into a yet-to-be-born branch.
  git-merge: make it usable as the first class UI
  remove merge-recursive-old

18 years agogit-merge: do not leak rev-parse output used for checking internally.
Junio C Hamano [Mon, 27 Nov 2006 06:19:42 +0000 (22:19 -0800)]
git-merge: do not leak rev-parse output used for checking internally.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-merge: tighten error checking.
Junio C Hamano [Mon, 27 Nov 2006 06:16:31 +0000 (22:16 -0800)]
git-merge: tighten error checking.

If a branch name to be merged is misspelled, the command leaked error
messages from underlying plumbing commands, which were helpful only
to people who know how the command are implemented to diagnose the
breakage, but simply puzzling and unhelpful for the end users.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoMerge branch 'jc/pack-peeled'
Junio C Hamano [Mon, 27 Nov 2006 06:09:41 +0000 (22:09 -0800)]
Merge branch 'jc/pack-peeled'

* jc/pack-peeled:
  Store peeled refs in packed-refs (take 2).
  Store peeled refs in packed-refs file.

18 years agogrep: do not skip unmerged entries when grepping in the working tree.
Junio C Hamano [Sun, 26 Nov 2006 20:47:52 +0000 (12:47 -0800)]
grep: do not skip unmerged entries when grepping in the working tree.

We used to skip unmerged entries, which made sense for grepping
in the cached copies, but not for grepping in the working tree.

Noticed by Johannes Sixt.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-tag: allow empty tag message if -m is given explicitly.
Han-Wen Nienhuys [Sun, 26 Nov 2006 16:42:49 +0000 (17:42 +0100)]
git-tag: allow empty tag message if -m is given explicitly.

Signed-off-by: Han-Wen Nienhuys <hanwen@xs4all.nl>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoMerge branch 'jn/web'
Junio C Hamano [Sun, 26 Nov 2006 06:54:45 +0000 (22:54 -0800)]
Merge branch 'jn/web'

* jn/web:
  gitweb: Make project description in projects list link to summary view
  gitweb: Use author_epoch for pubdate in gitweb feeds
  gitweb: Add author and contributor email to Atom feed
  gitweb: Add author and committer email extraction to parse_commit
  gitweb: Use git-show-ref instead of git-peek-remote
  gitweb: Do not use esc_html in esc_path

18 years agoDocumentation: clarify tutorial pull/merge discussion
J. Bruce Fields [Sun, 26 Nov 2006 03:45:02 +0000 (22:45 -0500)]
Documentation: clarify tutorial pull/merge discussion

Attempt to clarify somewhat the difference between pull and merge,
and give a little more details on the pull syntax.

I'm still not happy with this section: the explanation of the origin
branch isn't great, but maybe that should be left alone pending the
use-separate-remotes change; and we need to explain how to set up a
public repository and push to it.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: Make project description in projects list link to summary view
Jakub Narebski [Sun, 26 Nov 2006 01:18:26 +0000 (02:18 +0100)]
gitweb: Make project description in projects list link to summary view

Make (shortened) project description in the "projects list" view
hyperlink to the "summary" view of the project. Project names are
sometimes short; having project description be hyperling gives larger
are to click. While at it, display full description on mouseover via
'title' attribute to introduced link.

Additionally, fix whitespace usage in modified git_project_list_body
subroutine: tabs are for indent, spaces are for align.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-svn: allow SVN:: lib users to track the root of the repository (again)
Eric Wong [Sun, 26 Nov 2006 01:38:41 +0000 (17:38 -0800)]
git-svn: allow SVN:: lib users to track the root of the repository (again)

I broke this again in 747fa12cef73b6ca04fffaddaad7326cf546cdea.

Thanks to merlyn for pointing this out to me on IRC.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: Use author_epoch for pubdate in gitweb feeds
Jakub Narebski [Sat, 25 Nov 2006 14:54:34 +0000 (15:54 +0100)]
gitweb: Use author_epoch for pubdate in gitweb feeds

Use creation date (author_epoch) instead of former commit date
(committer_epoch) as publish date in gitweb feeds (RSS, Atom).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: Add author and contributor email to Atom feed
Jakub Narebski [Sat, 25 Nov 2006 14:54:33 +0000 (15:54 +0100)]
gitweb: Add author and contributor email to Atom feed

Add author email (from 'author_email') and contributor email (from
'committer_email') to items in the Atom format gitweb feed.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: Add author and committer email extraction to parse_commit
Jakub Narebski [Sat, 25 Nov 2006 14:54:32 +0000 (15:54 +0100)]
gitweb: Add author and committer email extraction to parse_commit

Extract author email to 'author_email' key, and comitter mail to
'committer_mail' key; uniquify committer and author lines handling
by the way.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: Use git-show-ref instead of git-peek-remote
Jakub Narebski [Sat, 25 Nov 2006 10:32:08 +0000 (11:32 +0100)]
gitweb: Use git-show-ref instead of git-peek-remote

Use "git show-ref --dereference" instead of "git peek-remote
$projectroot/project" in git_get_references. git-show-ref is faster
than git-peek-remote (40ms vs 56ms user+sys for git.git repository);
even faster is reading info/refs file (if it exists), but the
information in info/refs can be stale; that and the fact that
info/refs is meant for dumb protocol transports, not for gitweb.

git-show-ref is available since v1.4.4; the output format is slightly
different than git-peek-remote output format, but we accept both.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: Do not use esc_html in esc_path
Jakub Narebski [Sat, 25 Nov 2006 08:43:59 +0000 (09:43 +0100)]
gitweb: Do not use esc_html in esc_path

Do not use esc_html in esc_path subroutine to avoid double quoting;
expand esc_html body (except quoting) in esc_path.

Move esc_path before quot_cec and quot_upr. Add some comments.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-fetch: exit with non-zero status when fast-forward check fails
Junio C Hamano [Sat, 25 Nov 2006 09:04:28 +0000 (01:04 -0800)]
git-fetch: exit with non-zero status when fast-forward check fails

When update_local_ref() refuses to update a branch head due to
fast-forward check, it was not propagated properly in the call
chain and the command did not exit with non-zero status as a
result.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-shortlog: make common repository prefix configurable with .mailmap
Junio C Hamano [Sat, 25 Nov 2006 08:07:54 +0000 (00:07 -0800)]
git-shortlog: make common repository prefix configurable with .mailmap

The code had "/pub/scm/linux/kernel/git/" hardcoded which was
too specific to the kernel project.

With this, a line in the .mailmap file:

# repo-abbrev: /pub/scm/linux/kernel/git/

can be used to cause the substring to be abbreviated to /.../
on the title line of the commit message.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-shortlog: fix common repository prefix abbreviation.
Junio C Hamano [Sat, 25 Nov 2006 08:01:27 +0000 (00:01 -0800)]
git-shortlog: fix common repository prefix abbreviation.

The code to abbreviate the common repository prefix was totally
borked.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-svn: exit with status 1 for test failures
Eric Wong [Sat, 25 Nov 2006 06:38:18 +0000 (22:38 -0800)]
git-svn: exit with status 1 for test failures

Some versions of the SVN libraries cause die() to exit with 255,
and 40cf043389ef4cdf3e56e7c4268d6f302e387fa0 tightened up
test_expect_failure to reject return values >128.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-svn: correctly access repos when only given partial read permissions
Eric Wong [Sat, 25 Nov 2006 06:38:17 +0000 (22:38 -0800)]
git-svn: correctly access repos when only given partial read permissions

Sometimes users are given only read access to a subtree inside a
repository, and git-svn could not read log information (and thus
fetch commits) when connecting a session to the root of the
repository.  We now start an SVN::Ra session with the full URL
of what we're tracking, and not the repository root as before.

This change was made much easier with a cleanup of
repo_path_split() usage as well as improving the accounting of
authentication batons.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-branch -D: make it work even when on a yet-to-be-born branch
Junio C Hamano [Sat, 25 Nov 2006 07:10:23 +0000 (23:10 -0800)]
git-branch -D: make it work even when on a yet-to-be-born branch

This makes "git branch -D other_branch" work even when HEAD
points at a yet-to-be-born branch.

Earlier, we checked the HEAD ref for the purpose of "subset"
check even when the deletion was forced (i.e. not -d but -D).
Because of this, you cannot delete a branch even with -D while
on a yet-to-be-born branch.

With this change, the following sequence that now works:

mkdir newdir && cd newdir
git init-db
git fetch -k $other_repo refs/heads/master:refs/heads/othre
# oops, typo
git branch other othre
git branch -D othre

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoAdd -v and --abbrev options to git-branch
Lars Hjemli [Fri, 24 Nov 2006 13:45:10 +0000 (14:45 +0100)]
Add -v and --abbrev options to git-branch

The new -v option makes git-branch show the abbreviated sha1 + subjectline
for each branch.

Additionally, minimum abbreviation length can be specified with
--abbrev=<length>

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-clone: stop dumb protocol from copying refs outside heads/ and tags/.
Junio C Hamano [Sat, 25 Nov 2006 03:07:24 +0000 (19:07 -0800)]
git-clone: stop dumb protocol from copying refs outside heads/ and tags/.

Most notably, the original code first copied refs/remotes/ that
remote side had to local, and overwrote them by mapping refs/heads/
from the remote when a dumb protocol transport was used.

This makes the clone behaviour by dumb protocol in line with the
git native and rsync transports.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: (style) use chomp without parentheses consistently.
Junio C Hamano [Fri, 24 Nov 2006 22:04:01 +0000 (14:04 -0800)]
gitweb: (style) use chomp without parentheses consistently.

It seems that gitweb tries to consistently use chomp without parentheses
around its operands, but there were two places that said "chomp($var);".

Let's be consistent.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: Replace SPC with &nbsp; also in tag comment
Jakub Narebski [Fri, 24 Nov 2006 21:25:50 +0000 (22:25 +0100)]
gitweb: Replace SPC with &nbsp; also in tag comment

Commit messages had SPC replaced with &nbsp; entity;
make it so also in tag message (tag comment).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoAllow git push to delete remote ref.
Junio C Hamano [Fri, 24 Nov 2006 08:26:49 +0000 (00:26 -0800)]
Allow git push to delete remote ref.

This allows you to say

git send-pack $URL :refs/heads/$branch

to delete the named remote branch.  The refspec $src:$dst means
replace the destination ref with the object known as $src on the
local side, so this is a natural extension to make an empty $src
mean "No object" to delete the target.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoMerge branch 'jn/web'
Junio C Hamano [Fri, 24 Nov 2006 11:54:57 +0000 (03:54 -0800)]
Merge branch 'jn/web'

* jn/web:
  gitweb: Finish restoring "blob" links in git_difftree_body
  gitweb: Refactor feed generation, make output prettier, add Atom feed
  gitweb: Add an option to href() to return full URL
  gitweb: New improved formatting of chunk header in diff
  gitweb: Default to $hash_base or HEAD for $hash in "commit" and "commitdiff"
  gitweb: Buffer diff header to deal with split patches + git_patchset_body refactoring
  gitweb: Protect against possible warning in git_commitdiff

18 years agoMerge branch 'pb/diffroot'
Junio C Hamano [Fri, 24 Nov 2006 11:49:57 +0000 (03:49 -0800)]
Merge branch 'pb/diffroot'

* pb/diffroot:
  config option log.showroot to show the diff of root commits

18 years agoMerge branch 'jc/pack-heuristics'
Junio C Hamano [Fri, 24 Nov 2006 11:46:44 +0000 (03:46 -0800)]
Merge branch 'jc/pack-heuristics'

* jc/pack-heuristics:
  pack-objects: tweak "do not even attempt delta" heuristics

18 years agoMerge branch 'jc/numstat'
Junio C Hamano [Fri, 24 Nov 2006 11:46:40 +0000 (03:46 -0800)]
Merge branch 'jc/numstat'

* jc/numstat:
  apply --numstat: mark binary diffstat with - -, not 0 0

18 years agoMerge branch 'ap/branch-ref-display'
Junio C Hamano [Fri, 24 Nov 2006 11:43:46 +0000 (03:43 -0800)]
Merge branch 'ap/branch-ref-display'

* ap/branch-ref-display:
  Add support to git-branch to show local and remote branches

18 years agoMerge branch 'ap/prune'
Junio C Hamano [Fri, 24 Nov 2006 11:42:36 +0000 (03:42 -0800)]
Merge branch 'ap/prune'

* ap/prune:
  Typefix builtin-prune.c::prune_object()
  Improve git-prune -n output

18 years agoTypefix builtin-prune.c::prune_object()
Junio C Hamano [Fri, 24 Nov 2006 10:54:37 +0000 (02:54 -0800)]
Typefix builtin-prune.c::prune_object()

It passed (const char*) to a function that took a (char *); the
buffer itself was of course writable, so pass the buffer itself.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoconfig option log.showroot to show the diff of root commits
Peter Baumann [Thu, 23 Nov 2006 09:36:33 +0000 (10:36 +0100)]
config option log.showroot to show the diff of root commits

This allows one to see a root commit as a diff in commands like git-log,
git-show and git-whatchanged.

Signed-off-by: Peter Baumann <Peter.B.Baumannn@stud.informatik.uni-erlangen.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoMerge branch 'jc/upload-pack'
Junio C Hamano [Fri, 24 Nov 2006 10:34:27 +0000 (02:34 -0800)]
Merge branch 'jc/upload-pack'

* jc/upload-pack:
  upload-pack: stop the other side when they have more roots than we do.

18 years agogit-svn: handle authentication without relying on cached tokens on disk
Eric Wong [Fri, 24 Nov 2006 09:38:04 +0000 (01:38 -0800)]
git-svn: handle authentication without relying on cached tokens on disk

This is mostly gleaned off SVN::Mirror, with added support for
--no-auth-cache and --config-dir.

Even with this patch, git-svn does not yet support repositories
where the user only has partial read permissions.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-cvsimport: add support for CVS pserver method HTTP/1.x proxying
Iñaki Arenaza [Wed, 22 Nov 2006 22:26:57 +0000 (23:26 +0100)]
git-cvsimport: add support for CVS pserver method HTTP/1.x proxying

This patch adds support for 'proxy' and 'proxyport' connection options
when using the pserver method for the CVS Root.

It has been tested with a Squid 2.5.x proxy server.

Quoting from the CVS info manual:

     The `gserver' and `pserver' connection methods all accept optional
  method options, specified as part of the METHOD string, like so:

       :METHOD[;OPTION=ARG...]:

     Currently, the only two valid connection options are `proxy', which
  takes a hostname as an argument, and `proxyport', which takes a port
  number as an argument.  These options can be used to connect via an HTTP
  tunnel style web proxy.  For example, to connect pserver via a web proxy
  at www.myproxy.net and port 8000, you would use a method of:

       :pserver;proxy=www.myproxy.net;proxyport=8000:

     *NOTE: The rest of the connection string is required to connect to
  the server as noted in the upcoming sections on password authentication,
  gserver and kserver.  The example above would only modify the METHOD
  portion of the repository name.*

     PROXY must be supplied to connect to a CVS server via a proxy
  server, but PROXYPORT will default to port 8080 if not supplied.
  PROXYPORT may also be set via the CVS_PROXY_PORT environment variable.

Signed-off-by: Iñaki Arenaza <iarenuno@eteo.mondragon.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoMake git-clone --use-separate-remote the default
Petr Baudis [Thu, 23 Nov 2006 22:58:35 +0000 (23:58 +0100)]
Make git-clone --use-separate-remote the default

We've talked about this for quite some time on the list, and it
is a sane thing to do for a repository with an associcated
working tree.

For somebody who wants to use the traditional layout, there is a
backward compatibility option --use-immingled-remote, but it is
expected to be removed before the next major release.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agorefs outside refs/{heads,tags} match less strongly.
Junio C Hamano [Fri, 24 Nov 2006 05:52:18 +0000 (21:52 -0800)]
refs outside refs/{heads,tags} match less strongly.

This changes the refname matching logic used to decide which ref
is updated with git-send-pack.  We used to error out when
pushing 'master' when the other end has both 'master' branch and
a tracking branch 'remotes/$name/master' but with this, 'master'
matches only 'refs/heads/master' when both and no other 'master'
exist.

Pushing 'foo' when both heads/foo and tags/foo exist at the
remote end is still considered an error and you would need to
disambiguate between them by being more explicit.

When neither heads/foo nor tags/foo exists at the remote,
pushing 'foo' when there is only remotes/origin/foo is not
ambiguous, while it still is ambiguous when there are more than
one such weaker match (remotes/origin/foo and remotes/alt/foo,
for example).

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoIncrease length of function name buffer
Andy Parkins [Thu, 23 Nov 2006 10:05:17 +0000 (10:05 +0000)]
Increase length of function name buffer

In xemit.c:xdl_emit_diff() a buffer for showing the function name as
commentary is allocated; this buffer was 40 characters.  This is a bit
small; particularly for C++ function names where there is often an
identical prefix (like void LongNamespace::LongClassName) on multiple
functions, which makes the context the same everywhere.  In other words
the context is useless.  This patch increases that buffer to 80
characters - which may still not be enough, but is better

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-svn: preserve uncommitted changes after dcommit
Eric Wong [Thu, 23 Nov 2006 22:54:05 +0000 (14:54 -0800)]
git-svn: preserve uncommitted changes after dcommit

Using dcommit could cause the user to lose uncommitted changes
during the reset --hard operation, so change it to reset --mixed.

If dcommit chooses the rebase path, then git-rebase will already
error out when local changes are made.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-svn: correctly handle revision 0 in SVN repositories
Eric Wong [Thu, 23 Nov 2006 22:54:04 +0000 (14:54 -0800)]
git-svn: correctly handle revision 0 in SVN repositories

some SVN repositories have a revision 0 (committed by no author
and no date) when created; so when we need to ensure that we
check any revision variables are defined, and not just
non-zero.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-svn: error out from dcommit on a parent-less commit
Eric Wong [Thu, 23 Nov 2006 22:54:03 +0000 (14:54 -0800)]
git-svn: error out from dcommit on a parent-less commit

dcommit would unconditionally append "~1" to a commit in order
to generate a diff.  Now we generate a meaningful error message
if we try to generate an impossible diff.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoarchive-zip: don't use sizeof(struct ...)
René Scharfe [Thu, 23 Nov 2006 22:02:37 +0000 (23:02 +0100)]
archive-zip: don't use sizeof(struct ...)

We can't rely on sizeof(struct zip_*) returning the sum of
all struct members.  At least on ARM padding is added at the
end, as Gerrit Pape reported.  This fixes the problem but
still lets the compiler do the summing by introducing
explicit padding at the end of the structs and then taking
its offset as the combined size of the preceding members.

As Junio correctly notes, the _end[] marker array's size
must be greater than zero for compatibility with compilers
other than gcc.  The space wasted by the markers can safely
be neglected because we only have one instance of each
struct, i.e. in sum 3 wasted bytes on i386, and 0 on ARM. :)

We still rely on the compiler to not add padding between the
struct members, but that's reasonable given that all of them
are unsigned char arrays.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoGIT 1.4.4.1 v1.4.4.1
Junio C Hamano [Thu, 23 Nov 2006 00:57:34 +0000 (16:57 -0800)]
GIT 1.4.4.1

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agotrust-executable-bit: fix breakage for symlinks
Junio C Hamano [Thu, 23 Nov 2006 00:33:32 +0000 (16:33 -0800)]
trust-executable-bit: fix breakage for symlinks

An earlier commit f28b34a broke symlinks when trust-executable-bit
is not set because it incorrectly assumed that everything was a
regular file.

Reported by Juergen Ruehle.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoMove --pretty options into Documentation/pretty-formats.txt
Chris Riddoch [Tue, 21 Nov 2006 23:49:15 +0000 (16:49 -0700)]
Move --pretty options into Documentation/pretty-formats.txt

Asciidoc-include it into the manuals for programs that use the
--pretty command-line option, for consistency among the docs.

This describes all the pretty-formats currently listed in the cmit_fmt
enum in commit.h, and also briefly describes the presence and format
of the 'Merge: ' line in some pretty formats.

There's a hedge that limiting your view of history can affect what
goes in the Merge: line, and that --abbrev/--no-abbrev do nothing to
the 'raw' format.

Signed-off-by: Chris Riddoch <chris@syntacticsugar.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoStore peeled refs in packed-refs (take 2).
Junio C Hamano [Wed, 22 Nov 2006 07:36:35 +0000 (23:36 -0800)]
Store peeled refs in packed-refs (take 2).

This fixes the previous implementation which failed to optimize
repositories with tons of lightweight tags.  The updated
packed-refs format begins with "# packed-refs with:" line that
lists the kind of extended data the file records.  Currently,
there is only one such extension defined, "peeled".  This stores
the "peeled tag" on a line that immediately follows a line for a
tag object itself in the format "^<sha-1>".

The header line itself and any extended data are ignored by
older implementation, so packed-refs file generated with this
version can still be used by older git.  packed-refs made by
older git can of course be used with this version.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoAdd support to git-branch to show local and remote branches
Andy Parkins [Tue, 21 Nov 2006 19:31:24 +0000 (19:31 +0000)]
Add support to git-branch to show local and remote branches

Instead of storing a list of refnames in append_ref, a list of
structures is created.  Each of these stores the refname and a
symbolic constant representing its type.

The creation of the list is filtered based on a command line
switch; no switch means "local branches only", "-r" means "remote
branches only" (as they always did); but now "-a" means "local
branches or remote branches".

As a side effect, the list is now not global, but allocated in
print_ref_list() where it used.

Also a memory leak is plugged, the memory allocated during the
list creation was never freed.

It lays a groundwork to also display tags, but the command being
'git branch' it is not currently used.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agomerge: allow merging into a yet-to-be-born branch.
Junio C Hamano [Wed, 22 Nov 2006 05:13:28 +0000 (21:13 -0800)]
merge: allow merging into a yet-to-be-born branch.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-merge: make it usable as the first class UI
Junio C Hamano [Mon, 20 Nov 2006 09:06:09 +0000 (01:06 -0800)]
git-merge: make it usable as the first class UI

This teaches the oft-requested syntax

git merge $commit

to implement merging the named commit to the current branch.
This hopefully would make "git merge" usable as the first class
UI instead of being a mere backend for "git pull".

Most notably, $commit above can be any committish, so you can
say for example:

git merge js/shortlog~2

to merge early part of a topic branch without merging the rest
of it.

A custom merge message can be given with the new --message=<msg>
parameter.  The message is prepended in front of the usual
"Merge ..." message autogenerated with fmt-merge-message.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoremove merge-recursive-old
Junio C Hamano [Mon, 20 Nov 2006 08:49:31 +0000 (00:49 -0800)]
remove merge-recursive-old

This frees the Porcelain-ish that comes with the core Python-free.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoImprove git-prune -n output
Andy Parkins [Thu, 2 Nov 2006 11:12:26 +0000 (12:12 +0100)]
Improve git-prune -n output

prune_object() in show_only mode would previously just show the path to the
object that would be deleted.  The path the object is stored in shouldn't be
shown to users, they only know about sha1 identifiers so show that instead.

Further, the sha1 alone isn't that useful for examining what is going to be
deleted.  This patch also adds the object type to the output, which makes it
easy to pick out, say, the commits and use git-show to display them.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDoc: Make comment about merging in tutorial.txt more clear
Paolo Ciarrocchi [Mon, 20 Nov 2006 20:29:41 +0000 (21:29 +0100)]
Doc: Make comment about merging in tutorial.txt more clear

Rephrased a sentence in order to make more clear the concept of
pull . branch

Signed-off-by: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoarchive: use setvbuf() instead of setlinebuf()
Michal Rokos [Tue, 21 Nov 2006 22:19:28 +0000 (23:19 +0100)]
archive: use setvbuf() instead of setlinebuf()

This tiny patch makes GIT compile again on HP-UX 11i.

[jc: The setlinebuf() is described as unportable to BSD before
 4.2; it's not even in POSIX, while setvbuf() is in ISO C.]

Signed-off-by: Michal Rokos <michal.rokos@nextsoft.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: Finish restoring "blob" links in git_difftree_body
Jakub Narebski [Sun, 19 Nov 2006 21:51:39 +0000 (22:51 +0100)]
gitweb: Finish restoring "blob" links in git_difftree_body

This finishes work started by commit 4777b0141a4812177390da4b6ebc9d40ac3da4b5
  "gitweb: Restore object-named links in item lists"
by Petr Baudis. It brings back rest of "blob" links in difftree-raw
like part of "commit" and "commitdiff" views, namely in
git_difftree_body subroutine.

Now the td.link table cell has the following links:
 * link to diff ("blobdiff" view) in "commit" view, if applicable
   (there is no link to uninteresting creation/deletion diff), or
   link to patch anchor in "commitdiff" view.
 * link to current version of file ("blob" view), with the obvious
   exception of file deletion, where it is link to the parent
   version.
 * link to "blame" view, if it is enabled, and file was not just
   created (i.e. it has any history).
 * link to history of the file ("history" view), again with sole
   exception of the case of new file.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: Refactor feed generation, make output prettier, add Atom feed
Jakub Narebski [Sun, 19 Nov 2006 14:05:22 +0000 (15:05 +0100)]
gitweb: Refactor feed generation, make output prettier, add Atom feed

Add support for more modern Atom web feed format. Both RSS and Atom
feeds are generated by git_feed subroutine to avoid code duplication;
git_rss and git_atom are thin wrappers around git_feed. Add links to
Atom feed in HTML header and in page footer (but not in OPML; we
should use APP, Atom Publishing Proptocol instead).

Allow for feed generation for branches other than current (HEAD)
branch, and for generation of feeds for file or directory history.

Do not use "pre ${\sub_returning_scalar(...)} post" trick, but join
strings instead: "pre " . sub_returning_scalar(...) . " post".
Use href(-full=>1, ...) instead of hand-crafting gitweb urls.

Make output prettier:
* Use title similar to the title of web page
* Use project description (if exists) for description/subtitle
* Do not add anything (committer name, commit date) to feed entry title
* Wrap the commit message in <pre>
* Make file names into an unordered list
* Add links (diff, conditional blame, history) to the file list.

In addition to the above points, the attached patch emits a
Last-Changed: HTTP response header field, and doesn't compute the feed
body if the HTTP request type was HEAD. This helps keep the web server
load down for well-behaved feed readers that check if the feed needs
updating.

If browser (feed reader) sent Accept: header, and it prefers 'text/xml' type
to 'application/rss+xml' (in the case of RSS feed) or 'application/atom+xml'
(in the case of Atom feed), then use 'text/xml' as content type.

Both RSS and Atom feeds validate at http://feedvalidator.org
and at http://validator.w3.org/feed/

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Andreas Fuchs <asf@boinkor.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: Add an option to href() to return full URL
Jakub Narebski [Sun, 19 Nov 2006 14:05:21 +0000 (15:05 +0100)]
gitweb: Add an option to href() to return full URL

href subroutine by default generates absolute URL (generated using
CGI::url(-absolute=>1), and saved in $my_uri) using $my_uri as base;
add an option to generate full URL using $my_url as base.

New feature usage: href(..., -full=>1)

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: New improved formatting of chunk header in diff
Jakub Narebski [Sat, 18 Nov 2006 22:35:40 +0000 (23:35 +0100)]
gitweb: New improved formatting of chunk header in diff

If we have provided enough info, and diff is not combined diff,
and if provided diff line is chunk header, then:
* split chunk header into .chunk_info and .section span elements,
  first containing proper chunk header, second section heading
  (aka. which function), for separate styling: the proper chunk
  header is on non-white background, section heading part uses
  slightly lighter color.
* hyperlink from-file-range to starting line of from-file, if file
  was not created.
* hyperlink to-file-range to starting line of to-file, if file
  was not deleted.
Links are of invisible variety (and "list" class).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: Default to $hash_base or HEAD for $hash in "commit" and "commitdiff"
Jakub Narebski [Sat, 18 Nov 2006 22:35:41 +0000 (23:35 +0100)]
gitweb: Default to $hash_base or HEAD for $hash in "commit" and "commitdiff"

Set $hash parameter to $hash_base || "HEAD" if it is not set (if it is
not true to be more exact). This allows [hand-edited] URLs with 'action'
"commit" or "commitdiff" but without 'hash' parameter.

If there is 'h' (hash) parameter provided, then gitweb tries
to use this. HEAD is used _only_ if nether hash, nor hash_base
are provided, i.e. for URL like below
  URL?p=project.git;a=commit
i.e. without neither 'h' nor 'hb'.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: Buffer diff header to deal with split patches + git_patchset_body refactoring
Jakub Narebski [Sat, 18 Nov 2006 22:35:39 +0000 (23:35 +0100)]
gitweb: Buffer diff header to deal with split patches + git_patchset_body refactoring

There are some cases when one line from "raw" git-diff output (raw format)
corresponds to more than one patch in the patchset git-diff output. To deal
with this buffer git diff header and extended diff header (everything up to
actual patch) to check from information from "index <hash>..<hash>" extended
header line if the patch corresponds to the same or next difftree raw line.

This could also be used to gather information needed for hyperlinking, and
used for printing gitweb quoted filenames, from extended diff header instead
of raw git-diff output.

While at it, refactor git_patchset_body subroutine from the event-driven,
AWK-like state-machine parsing to sequential parsing: for each patch
parse (and output) git diff header, parse extended diff header, parse two-line
from-file/to-file diff header, parse patch itself; patch ends with the end
of input [file] or the line matching m/^diff /.

For better understanding the code, there were added assertions in the
comments a la Carp::Assert module. Just in case there is commented out code
dealing with unexpected end of input (should not happen, hence commented
out).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: Protect against possible warning in git_commitdiff
Jakub Narebski [Sat, 18 Nov 2006 22:35:38 +0000 (23:35 +0100)]
gitweb: Protect against possible warning in git_commitdiff

We may read an undef from <$fd> and unconditionally chomping it
would result in a warning.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agobuiltin git-shortlog is broken
Nicolas Pitre [Tue, 21 Nov 2006 20:49:45 +0000 (15:49 -0500)]
builtin git-shortlog is broken

Another small patch to fix the output result to be conform with the
perl version.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoshortlog: fix "-n"
Johannes Schindelin [Tue, 21 Nov 2006 20:12:06 +0000 (21:12 +0100)]
shortlog: fix "-n"

Since it is now a builtin optionally taking a range, we have to parse
the options before the rev machinery, to be able to shadow the short
hand "-n" for "--max-count".

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoTeach SubmittingPatches about git-commit -s
Paolo Ciarrocchi [Tue, 21 Nov 2006 18:55:20 +0000 (19:55 +0100)]
Teach SubmittingPatches about git-commit -s

As discussed on git mailing list let's teach the reader about
the possiblity to have automatically signed off the commit running
the git-commit -s command

Signed-off-by: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoshortlog: handle email addresses case-insensitively
Johannes Schindelin [Sun, 19 Nov 2006 16:29:14 +0000 (17:29 +0100)]
shortlog: handle email addresses case-insensitively

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoshortlog: read mailmap from ./.mailmap again
Johannes Schindelin [Sun, 19 Nov 2006 16:28:51 +0000 (17:28 +0100)]
shortlog: read mailmap from ./.mailmap again

While at it, remove the linux specific mailmap into
contrib/mailmap.linux.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoshortlog: do not crash on parsing "[PATCH"
Johannes Schindelin [Sun, 19 Nov 2006 16:28:25 +0000 (17:28 +0100)]
shortlog: do not crash on parsing "[PATCH"

Annoyingly, it looked for the closing bracket in the author name
instead of in the message, and then accessed the NULL pointer.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoBuild in shortlog
Johannes Schindelin [Sun, 22 Oct 2006 11:23:31 +0000 (13:23 +0200)]
Build in shortlog

[jc: with minimum squelching of compiler warning under "-pedantic"
 compilation options.]

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoStore peeled refs in packed-refs file.
Junio C Hamano [Sun, 19 Nov 2006 21:22:44 +0000 (13:22 -0800)]
Store peeled refs in packed-refs file.

This would speed up "show-ref -d" in a repository with mostly
packed tags.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agodo_for_each_ref: perform the same sanity check for leftovers.
Junio C Hamano [Sun, 19 Nov 2006 06:13:33 +0000 (22:13 -0800)]
do_for_each_ref: perform the same sanity check for leftovers.

An earlier commit b37a562a added a check to see if the ref
points at a valid object (as a part of 'negative ref' support
which we currently do not use), but did so only while iterating
over both packed and loose refs, and forgot to apply the same
check while iterating over the remaining ones.

We might want to replace the "if null then omit it" check with
"eh --- what business does a 0{40} value have here?" complaint
later since we currently do not use negative refs, but that is
a separate issue.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-fetch: follow lightweit tags as well.
Junio C Hamano [Sun, 19 Nov 2006 05:39:17 +0000 (21:39 -0800)]
git-fetch: follow lightweit tags as well.

This side-ports commit fd19f620 from Cogito, in which I fixed
exactly the same bug.  Somehow nobody noticed this for a long
time in git.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDocumentation: Correct alternates documentation, document http-alternates
Petr Baudis [Sat, 18 Nov 2006 23:30:15 +0000 (00:30 +0100)]
Documentation: Correct alternates documentation, document http-alternates

For one, the documentation invalidly claimed that the paths have to be
absolute when that's not the case and in fact there is a very valid reason
not to use absolute paths (documented the reason as well).

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDocumentation: Define symref and update HEAD description
Petr Baudis [Sat, 18 Nov 2006 19:44:08 +0000 (20:44 +0100)]
Documentation: Define symref and update HEAD description

HEAD was still described as a symlink instead of a symref.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoDocument git-runstatus
Rene Scharfe [Sat, 18 Nov 2006 14:15:49 +0000 (15:15 +0100)]
Document git-runstatus

I copied most of the text from git-status.txt.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-apply: slightly clean up bitfield usage
Rene Scharfe [Sat, 18 Nov 2006 12:07:09 +0000 (13:07 +0100)]
git-apply: slightly clean up bitfield usage

This patch fixes a sparse warning about inaccurate_eof being a
"dubious one-bit signed bitfield", makes three more binary
variables members of this (now unsigned) bitfield and adds a
short comment to indicate the nature of two ternary variables.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agosparse fix: Using plain integer as NULL pointer
Rene Scharfe [Sat, 18 Nov 2006 12:06:56 +0000 (13:06 +0100)]
sparse fix: Using plain integer as NULL pointer

Z_NULL is defined as 0, use a proper NULL pointer in its stead.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agosparse fix: non-ANSI function declaration
Rene Scharfe [Sat, 18 Nov 2006 12:07:06 +0000 (13:07 +0100)]
sparse fix: non-ANSI function declaration

The declaration of discard_cache() in cache.h already has its "void".

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-apply: Documentation typo fix
Petr Baudis [Sat, 18 Nov 2006 05:05:11 +0000 (06:05 +0100)]
git-apply: Documentation typo fix

inacurate -> inaccurate, sorry if it was a pun. ;-)

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoFix git-for-each-refs broken for tags
Petr Baudis [Sat, 18 Nov 2006 02:56:52 +0000 (03:56 +0100)]
Fix git-for-each-refs broken for tags

Unfortunately, git-for-each-refs is currently unusable for peeking into tag
comments, since it uses freed pointers, so it just prints out all sort of
garbage.

This makes it strdup() contents and body values.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agopack-objects: tweak "do not even attempt delta" heuristics
Junio C Hamano [Wed, 15 Nov 2006 06:18:31 +0000 (22:18 -0800)]
pack-objects: tweak "do not even attempt delta" heuristics

The heuristics to give up deltification when both the source and the
target are both in the same pack affects negatively when we are
repacking the subset of objects in the existing pack.  This caused
any incremental updates to use suboptimal packs.  Tweak the heuristics
to avoid this problem.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years ago"git fmt-merge-msg" SIGSEGV
Linus Torvalds [Fri, 17 Nov 2006 06:57:20 +0000 (22:57 -0800)]
"git fmt-merge-msg" SIGSEGV

Ok, this is a _really_ stupid case, and I don't think it matters, but hey,
we should never SIGSEGV.

Steps to reproduce:

mkdir duh
cd duh
git init-db
git-fmt-merge-msg < /dev/null

will cause a SIGSEGV in cmd_fmt_merge_msg(), because we're doing a
strncmp() with a NULL current_branch.

And yeah, it's an insane schenario, and no, it doesn't really matter. The
only reason I noticed was that a broken version of my "git pull" into an
empty directory would cause this.

This silly patch just replaces the SIGSEGV with a controlled exit with an
error message.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-pull: allow pulling into an empty repository
Linus Torvalds [Thu, 16 Nov 2006 19:47:22 +0000 (11:47 -0800)]
git-pull: allow pulling into an empty repository

We used to complain that we cannot merge anything we fetched
with a local branch that does not exist yet.  Just treat the
case as a natural extension of fast forwarding and make the
local branch'es tip point at the same commit we just fetched.
After all an empty repository without an initial commit is an
ancestor of any commit.

[jc: I added a trivial test.  We've become sloppy but we should
 stick to the discipline of covering new behaviour with new
 tests. ]

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoconvert-objects: set _XOPEN_SOURCE to 600
Junio C Hamano [Wed, 15 Nov 2006 22:57:47 +0000 (14:57 -0800)]
convert-objects: set _XOPEN_SOURCE to 600

Otherwise OpenBSD header files drop S_ISLNK() definition which is used in
an inline defined in cache.h

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoRun "git repack -a -d" once more at end, if there's 1MB or more of not-packed data.
Jim Meyering [Wed, 15 Nov 2006 20:15:44 +0000 (21:15 +0100)]
Run "git repack -a -d" once more at end, if there's 1MB or more of not-packed data.

Although I converted upstream coreutils to git last month, I just
reconverted coreutils once again, as a test, and ended up with a
git repository of about 130MB (contrast with my packed git repo of
size 52MB).  That was because there were a lot of commits (but < 1024)
after the final automatic "git-repack -a -d".

Running a final
  git-repack -a -d && git-prune-packed
cut the final repository size down to the expected size.

So this looks like an easy way to improve git-cvsimport.
Just run "git repack ..." at the end if there's more than
some reasonable amount of not-packed data.

My choice of 1MB is a little arbitrarily.  I wouldn't mind missing
the minimal repo size by 1MB.  At the other end of the spectrum,
it's probably not worthwhile to pack everything when the total
repository size is less than 1MB.

Here's the patch:

Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogitweb: Put back shortlog instead of graphiclog in the project list.
Alexandre Julliard [Wed, 15 Nov 2006 20:37:50 +0000 (21:37 +0100)]
gitweb: Put back shortlog instead of graphiclog in the project list.

Looks like a repo.or.cz-specific change slipped in.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-checkout: allow pathspec to recover lost working tree directory
Junio C Hamano [Wed, 15 Nov 2006 18:54:10 +0000 (10:54 -0800)]
git-checkout: allow pathspec to recover lost working tree directory

It is often wanted on the #git channel that this were to work to
recover removed directory:

rm -fr Documentation
git checkout -- Documentation
git checkout HEAD -- Documentation ;# alternatively

Now it does.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agogit-checkout: do not allow -f and -m at the same time.
Junio C Hamano [Wed, 15 Nov 2006 18:46:10 +0000 (10:46 -0800)]
git-checkout: do not allow -f and -m at the same time.

Instead of silently ignoring one over the other, complain on
this incompatible combination.

Signed-off-by: Junio C Hamano <junkio@cox.net>
18 years agoSeek back to current filepos when mmap()ing with NO_MMAP
Johannes Schindelin [Wed, 15 Nov 2006 16:27:54 +0000 (17:27 +0100)]
Seek back to current filepos when mmap()ing with NO_MMAP

"git-index-pack --fix-thin" relies on mmap() not changing the current
file position (otherwise the pack will be corrupted when writing the
final SHA1). Meet that expectation.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>