Commit Graph

7093 Commits

Author SHA1 Message Date
Eric Wong
0864e3ba12 git-svn: fix output reporting from the delta fetcher
There was nothing printed in the code originally because I left
out a pair of parentheses.  Nevertheless, the affected code has
been replaced with a more efficient version that respects the -q
flag as well as requiring less bandwidth.

We save some bandwidth by not requesting changed paths
information when calling get_log() since we're using the delta
fetcher.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-28 14:22:52 -08:00
Eric Wong
dad73c0bb9 git-svn: error out when the SVN connection fails during a fetch
finish_report does seem to return a useful value indicating success
or failure, so we'll just set a flag when close_edit is called
(it is not called on failures, nor is abort_edit) and check
the flag before proceeding.

Thanks to Pazu for pointing this out.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-28 14:13:43 -08:00
René Scharfe
c3e4393883 shortlog: remove range check
Don't force the user to specify more than one revision parameter,
thus making git-shortlog behave more like git-log.
'git-shortlog master' will now produce the expected results; the
other end of the range simply is the (oldest) root commit.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-28 14:00:28 -08:00
Eric Wong
e15161198a git-svn: update tests for recent changes
* Enable test for delta transfers in full-svn-test.

* Run tests against the root of the repository so we won't have
  to revisit 308906fa6e and
  efe4631def again.
  The graft-branches test still runs as before.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27 22:23:06 -08:00
Eric Wong
27a1a8014b git-svn: enable delta transfers during fetches when using SVN:: libs
This should drastically reduce bandwidth used for network
transfers.  This is not enabled for file:// repositories by
default because of the increased CPU usage and I/O needed.

GIT_SVN_DELTA_FETCH may be set to a true value to enable or
false (0) to disable delta transfers regardless of the
repository type.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27 22:22:57 -08:00
Andy Parkins
255cae88bc Use .git/config for storing "origin" shortcut repository
Rather than use a separate config .git/remotes/ for remote shortcuts, this
patch adds the analagous definitions to .git/config using git-repo-config
calls.

For example what was previously .git/remotes/origin
  URL: proto://host/path
  Pull: refs/heads/master:refs/heads/origin
Is now added to .git/config as
  [remote "origin"]
  url = proto://host/path
  fetch = refs/heads/master:refs/heads/origin

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27 17:08:41 -08:00
Johannes Schindelin
f0df4ed562 sha1_object_info(): be consistent with read_sha1_file()
We used to try loose objects first with sha1_object_info(), but packed
objects first with read_sha1_file(). Now, prefer packed objects over loose
ones with sha1_object_info(), too.

Usually the old behaviour would pose no problem, but when you tried to fix
a fscked up repository by inserting a known-good pack,

	git cat-file $(git cat-file -t <sha1>) <sha1>

could fail, even when

	git cat-file blob <sha1>

would _not_ fail. Worse, a repack would fail, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27 16:56:54 -08:00
Johannes Schindelin
1d541c120b shortlog: use pager
On request of the kingpenguin, shortlog now uses the pager if output
goes to a tty.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27 16:55:42 -08:00
Junio C Hamano
86d11cf264 cvsimport: style fixup.
This should not change any functionality, but just makes it readable by
having a space between syntactic construct keyword and open parenthesis
(e.g. "if (expr", not "if(expr") and between close parenthesis and open
brace (e.g. "if (expr) {" not "if (expr){").

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27 14:21:30 -08:00
Eric Wong
6f23ebf600 git-svn: use ~/.subversion config files when using SVN:: libraries
This allows users to use HTTP proxy information (among other settings)
from ~/.subversion/servers and ~/.subversion/config

--config-dir (as before) may be passed to git-svn to override the
default choice of '~/.subversion' for the configuration directory.

Thanks to tko on #git for pointing this out.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27 13:55:49 -08:00
Shawn O. Pearce
8832919515 Teach bash about git-am/git-apply and their whitespace options.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27 12:57:22 -08:00
Shawn O. Pearce
b51ec6bddb Cache the list of merge strategies and available commands during load.
Since the user's git installation is not likely to grow a new command
or merge strategy in the lifespan of the current shell process we can
save time during completion operations by caching these lists during
sourcing of the completion support.

If the git executable is not available or we run into errors while
caching at load time then we defer these to runtime and generate
the list on the fly.  This might happen if the user doesn't put git
into their PATH until after the completion script gets sourced.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27 12:57:21 -08:00
Shawn O. Pearce
ce1e39d29e Support --strategy=x completion in addition to --strategy x.
Because git-merge and git-rebase both accept -s, --strategy or --strategy=
we should recognize all three formats in the bash completion functions and
issue back all merge strategies on demand.

I also moved the prior word testing to be before the current word testing,
as the current word cannot be completed with -- if the prior word was an
option which requires a parameter, such as -s or --strategy.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27 12:57:15 -08:00
Shawn O. Pearce
5de40f59d4 Teach bash about git-repo-config.
This is a really ugly completion script for git-repo-config, but it has
some nice properties.  I've added all of the documented configuration
parameters from Documentation/config.txt to the script, allowing the
user to complete any standard configuration parameter name.

We also have some intelligence for the remote.*.* and branch.*.* keys
by completing not only the key name (e.g. remote.origin) but also the
values (e.g. remote.*.fetch completes to the branches available on the
corresponding remote).

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27 12:17:59 -08:00
Shawn O. Pearce
35e65ecca7 Support bash completion of refs/remote.
Now that people are really likely to start using separate remotes
(due to the default in git-clone changing) we should support ref
completion for these refs in as many commands as possible.

While we are working on this routine we should use for-each-ref
to obtain a list of local refs, as this should run faster than
peek-remote as it does not need to dereference tag objects in
order to produce the list of refs back to us.  It should also
be more friendly to users of StGIT as we won't generate a list
of the StGIT metadata refs.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-27 12:17:52 -08:00
Shawn O. Pearce
6e31b866e4 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>
2006-11-27 12:11:12 -08:00
Shawn O. Pearce
61d926a3cd 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>
2006-11-27 12:11:07 -08:00
Shawn O. Pearce
1273231ee9 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>
2006-11-27 12:10:50 -08:00
Shawn O. Pearce
f53352fbaf 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>
2006-11-27 12:09:58 -08:00
Shawn O. Pearce
d3d717a4ad 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>
2006-11-27 12:09:16 -08:00
Shawn O. Pearce
d33909bf6e 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>
2006-11-27 12:09:10 -08:00
Shawn O. Pearce
f2bb9f8880 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>
2006-11-27 12:09:04 -08:00
Shawn O. Pearce
4ad91321ee 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>
2006-11-27 12:08:58 -08:00
Sean
fde97d8ac6 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>
2006-11-27 12:08:36 -08:00
Junio C Hamano
3c23bea8ac 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
2006-11-26 22:51:38 -08:00
Junio C Hamano
a22f542700 Merge branch 'jc/push-delete-ref'
* jc/push-delete-ref:
  Allow git push to delete remote ref.
2006-11-26 22:51:17 -08:00
Junio C Hamano
88ffc1f28a 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
2006-11-26 22:19:56 -08:00
Junio C Hamano
c175161638 git-merge: do not leak rev-parse output used for checking internally.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-26 22:19:42 -08:00
Junio C Hamano
51901e96bf 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>
2006-11-26 22:16:31 -08:00
Junio C Hamano
d63afe9ebb Merge branch 'jc/pack-peeled'
* jc/pack-peeled:
  Store peeled refs in packed-refs (take 2).
  Store peeled refs in packed-refs file.
2006-11-26 22:09:41 -08:00
Junio C Hamano
36f2587ffb 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>
2006-11-26 14:22:01 -08:00
Han-Wen Nienhuys
aabd76930f 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>
2006-11-26 12:24:44 -08:00
Junio C Hamano
9f6db11ac5 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
2006-11-25 22:54:45 -08:00
J. Bruce Fields
93ee7823c0 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>
2006-11-25 22:46:35 -08:00
Jakub Narebski
e88ce8a456 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>
2006-11-25 20:00:22 -08:00
Eric Wong
efe4631def git-svn: allow SVN:: lib users to track the root of the repository (again)
I broke this again in 747fa12cef.

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>
2006-11-25 19:59:32 -08:00
Jakub Narebski
91fd2bf3fd 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>
2006-11-25 13:54:32 -08:00
Jakub Narebski
ab23c19d67 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>
2006-11-25 13:54:32 -08:00
Jakub Narebski
ba00b8c1ed 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>
2006-11-25 13:54:32 -08:00
Jakub Narebski
28b9d9f7c6 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>
2006-11-25 13:54:32 -08:00
Jakub Narebski
391862e345 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>
2006-11-25 01:45:26 -08:00
Junio C Hamano
310b86d480 fetch-pack: do not barf when duplicate re patterns are given
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-25 01:33:06 -08:00
Junio C Hamano
d945d4be20 git-fetch: allow forcing glob pattern in refspec
Building on top of the earlier refspec glob pattern enhancement,
this allows a glob pattern to say the updates should be forced
by prefixing it with '+' as usual, like this:

	Pull: +refs/heads/*:refs/remotes/origin/*

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-25 01:10:10 -08:00
Junio C Hamano
cadd8a7d4d Merge branch 'master' into jc/globfetch
This is to pick up the fix made on master:

  git-fetch: exit with non-zero status when fast-forward check fails
2006-11-25 01:07:15 -08:00
Junio C Hamano
f64d7fd267 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>
2006-11-25 01:04:28 -08:00
Junio C Hamano
7595e2ee6e 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>
2006-11-25 00:07:54 -08:00
Junio C Hamano
c95044d4f3 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>
2006-11-25 00:01:27 -08:00
Eric Wong
d25c26e771 git-svn: exit with status 1 for test failures
Some versions of the SVN libraries cause die() to exit with 255,
and 40cf043389 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>
2006-11-24 23:17:00 -08:00
Eric Wong
747fa12cef 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>
2006-11-24 23:16:58 -08:00
Junio C Hamano
67affd5173 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>
2006-11-24 23:10:23 -08:00