1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-06 09:13:01 +01:00
Commit graph

1073 commits

Author SHA1 Message Date
Reece H. Dunn
7da660f437 git-p4: Fix the sorting of changelists when cloning a Perforce repository.
When performing a git-p4 clone operation on a Perforce repository,
where the changelists change in order of magnitude (e.g. 100 to 1000),
the set of changes to import from is not sorted properly. This is
because the data in the list is strings not integers. The other place
where this is done already converts the value to an integer, so it is
not affected.

Acked-by: Simon Hausmann <simon@lst.de>
2007-08-13 15:23:14 -07:00
Alexandre Julliard
8fdc39729b git.el: Always set the current directory in the git-diff buffer.
This allows jumping to the correct file with the diff-mode commands.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-13 12:58:38 -07:00
Alexandre Julliard
09afcd6933 git.el: Add support for interactive diffs.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-13 12:58:38 -07:00
Junio C Hamano
55d1932bce Merge branch 'cr/tag'
* cr/tag:
  Teach "git stripspace" the --strip-comments option
  Make verify-tag a builtin.
  builtin-tag.c: Fix two memory leaks and minor notation changes.
  launch_editor(): Heed GIT_EDITOR and core.editor settings
  Make git tag a builtin.
2007-08-10 23:17:46 -07:00
Shawn O. Pearce
cabead982b 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>
2007-08-10 01:00:25 -07:00
Shawn O. Pearce
d47eed3272 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>
2007-08-10 01:00:16 -07:00
Shawn O. Pearce
b767c792fa 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>
2007-08-10 00:59:43 -07:00
Simon Hausmann
ea99c3ae0e 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>
2007-08-08 13:45:04 -07:00
Simon Hausmann
74276ec6f2 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>
2007-08-08 01:58:05 -07:00
Junio C Hamano
2ec39edad9 INSTALL: add warning on docbook-xsl 1.72 and 1.73
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-04 01:55:08 -07:00
Junio C Hamano
7fd53fce1c 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>
2007-08-04 03:14:28 -04:00
Han-Wen Nienhuys
7fcff9def5 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>
2007-08-02 09:40:28 +02:00
Han-Wen Nienhuys
a4eba020f9 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>
2007-08-02 09:40:25 +02:00
Alexandre Julliard
274e13e0e9 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>
2007-07-31 23:05:43 -07:00
Alexandre Julliard
61988f1127 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>
2007-07-31 23:04:10 -07:00
Carlos Rica
2ae68fcb78 Make verify-tag a builtin.
This replaces "git-verify-tag.sh" with "builtin-verify-tag.c".

Testing relies on the "git tag -v" tests calling this command.

A temporary file is needed when calling to gpg, because git is
already creating detached signatures (gpg option -b) to sign tags
(instead of leaving gpg to add the signature to the file by itself),
and those signatures need to be supplied in a separate file to be
verified by gpg.

The program uses git_mkstemp to create that temporary file needed by
gpg, instead of the previously used "$GIT_DIR/.tmp-vtag", in order to
allow the command to be used in read-only repositories, and also
prevent other instances of git to read or remove the same file.

Signal SIGPIPE is ignored because the program sometimes was
terminated because that signal when writing the input for gpg.

The command now can receive many tag names to be verified.
Documentation is also updated here to reflect this new behaviour.

Signed-off-by: Carlos Rica <jasampler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-26 22:51:27 -07:00
Simon Hausmann
b2d2d16af7 git-p4: Fix p4 user cache population on Windows.
Fall back to USERPROFILE if HOME isn't set.

Signed-off-by: Simon Hausmann <shausman@trolltech.com>
Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-25 16:06:54 -07:00
Alexandre Julliard
ceefa44fe2 git.el: Pass an explicit argument to enable smerge-mode.
Without argument the mode is toggled, which would do the wrong thing
if the file was already open.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-25 00:06:38 -07:00
Alexandre Julliard
93c22eeb30 git.el: Support for incremental status updates.
When we know which files have been modified, we can now run diff-index
or ls-files with a file list to refresh only the specified files
instead of the whole project.

This also allows proper refreshing of files upon add/delete/resolve,
instead of making assumptions about the new file state.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-24 03:16:26 -07:00
Carlos Rica
62e09ce998 Make git tag a builtin.
This replaces the script "git-tag.sh" with "builtin-tag.c".

The existing test suite for "git tag" guarantees the compatibility
with the features provided by the script version.

There are some minor changes in the behaviour of "git tag" here:
"git tag -v" now can get more than one tag to verify, like "git tag -d" does,
"git tag" with no arguments prints all tags, more like "git branch" does,
and "git tag -n" also prints all tags with annotations (without needing -l).
Tests and documentation were also updated to reflect these changes.

The program is currently calling the script "git verify-tag" for verify.
This can be changed porting it to C and calling its functions directly
from builtin-tag.c.

Signed-off-by: Carlos Rica <jasampler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-20 01:27:25 -07:00
Junio C Hamano
6fb73e442a Merge branch 'master' of git://people.freedesktop.org/~hausmann/git-p4
* 'master' of git://people.freedesktop.org/~hausmann/git-p4:
  git-p4: Cleanup, used common function for listing imported p4 branches
  git-p4: Fix upstream branch detection for submit/rebase with multiple branches.
  git-p4: Cleanup, make listExistingP4Branches a global function for later use.
  git-p4: input to "p4 files" by stdin instead of arguments
  git-p4: use subprocess in p4CmdList
2007-07-18 17:23:03 -07:00
Simon Hausmann
144ff46b19 git-p4: Cleanup, used common function for listing imported p4 branches
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-07-18 17:29:38 +02:00
Simon Hausmann
86506fe54c git-p4: Fix upstream branch detection for submit/rebase with multiple branches.
Don't use git name-rev to locate the upstream git-p4 branch for rebase and submit but instead locate the branch by comparing the depot paths.
name-rev may produce results like wrongbranch~12 as it uses the first match.

Signed-off-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
2007-07-18 17:29:31 +02:00
Simon Hausmann
062410bb9d git-p4: Cleanup, make listExistingP4Branches a global function for later use.
Signed-off-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
2007-07-18 17:29:05 +02:00
Scott Lamb
788001908c git-p4: input to "p4 files" by stdin instead of arguments
This approach, suggested by Alex Riesen, bypasses the need for xargs-style
argument list handling. The handling in question looks broken in a corner
case with SC_ARG_MAX=4096 and final argument over 96 characters.

Signed-off-by: Scott Lamb <slamb@slamb.org>
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-07-17 08:35:33 +02:00
Scott Lamb
9f90c7335e git-p4: use subprocess in p4CmdList
This allows bidirectional piping - useful for "-x -" to avoid commandline
arguments - and is a step toward bypassing the shell.

Signed-off-by: Scott Lamb <slamb@slamb.org>
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-07-17 08:35:24 +02:00
David Kastrup
99c01de402 contrib/emacs/Makefile: Also install .el files.
Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-15 20:21:51 -07:00
Sean
e3b4968f9c Demote git-p4import to contrib status.
Move git-p4import.py and Documentation/git-p4import.txt into
a contrib/p4import directory.   Add a README there directing
people to contrib/fast-import/git-p4 as a better alternative.

Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-15 15:23:37 -07:00
Emil Medve
4cb08df553 Use $(RM) in Makefiles instead of 'rm -f'
Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-14 23:31:01 -07:00
Junio C Hamano
3f2fd36ebc Merge branch 'master' of git://repo.or.cz/git/fastimport
* 'master' of git://repo.or.cz/git/fastimport:
  Teach fast-import to recursively copy files/directories
  Fix git-p4 on Windows to not use the Posix sysconf function.
  Correct trivial typo in fast-import documentation
2007-07-14 22:57:47 -07:00
Marius Storm-Olsen
48b4c3d5ab Fix git-p4 on Windows to not use the Posix sysconf function.
Add condition for Windows, since it doesn't support the os.sysconf module.
We hardcode the commandline limit to 2K, as that should work on most
Windows platforms.

Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
Acked-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-14 22:47:14 -04:00
Junio C Hamano
af6861b144 Add contrib/stats/mailmap.pl script
This script reads the existing commit log and .mailmap file,
and outputs author e-mail addresses that would map to more
than one names (most likely due to difference in the way they
are spelled, but some are due to ancient botched commits).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-14 13:43:49 -07:00
David Kastrup
248c648a0d Add missing functions to contrib/emacs/vc-git.el
This is necessary to make several editing functions work, like
C-u C-x v =

Signed-off-by: David Kastrup <dak@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-12 14:38:15 -07:00
Brian Downing
b492bbd836 Correct shebang line for contrib/stats/packinfo.pl
"/bin/perl"?  What was I thinking?

Signed-off-by: Brian Downing <bdowning@lavos.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-12 14:18:24 -07:00
Nicolas Pitre
750bd6ac35 script to display a distribution of longest common hash prefixes
This script was originally posted on the git mailing list by
Randal L. Schwartz <merlyn@stonehenge.com>.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-12 14:18:15 -07:00
Brian Downing
73f8936050 Pack information tool
This tool will print vaguely pretty information about a pack.  It
expects the output of "git-verify-pack -v" as input on stdin.

$ git-verify-pack -v | packinfo.pl

See the documentation in the script (contrib/stats/packinfo.pl)
for more information.

Signed-off-by: Brian Downing <bdowning@lavos.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-11 21:15:23 -07:00
Johannes Schindelin
b4372ef136 Enable "git rerere" by the config variable rerere.enabled
Earlier, "git rerere" was enabled by creating the directory
.git/rr-cache.  That is definitely not in line with most other
features, which are enabled by a config variable.

So, check the config variable "rerere.enabled". If it is set
to "false" explicitely, do not activate rerere, even if
.git/rr-cache exists. This should help when you want to disable
rerere temporarily.

If "rerere.enabled" is not set at all, fall back to detection
of the directory .git/rr-cache.

[jc: with minimum tweaks]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-06 22:39:15 -07:00
Junio C Hamano
5be60078c9 Rewrite "git-frotz" to "git frotz"
This uses the remove-dashes target to replace "git-frotz" to "git frotz".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-02 22:52:14 -07:00
Junio C Hamano
9cc0589ae8 Merge branch 'master' of git://repo.or.cz/git/fastimport
* 'master' of git://repo.or.cz/git/fastimport:
  Teach bash how to complete +refspec on git-push
2007-06-26 22:23:29 -07:00
Simon Hausmann
b658d50325 git-new-workdir: Fix shell warning about operator == used with test.
Use = instead of == with test to test for equality.

Signed-off-by: Simon Hausmann <simon@lst.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-26 18:18:47 -07:00
Shawn O. Pearce
161fea832a Teach bash how to complete +refspec on git-push
Using `git push origin +foo` to forcefully overwrite the remote
branch named foo is a common idiom, especially since + is shorter
than the long option --force and can be specified on a per-branch
basis.

We now complete `git push origin +foo` just like we do the standard
`git push origin foo`.  The leading + on a branch refspec does not
alter the completion.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-06-24 19:42:16 -04:00
Julian Phillips
09381b458f new-workdir: handle rev-parse --git-dir not always giving full path
rev-parse --git-dir outputs a full path - except for the single case
of when the path would be $(pwd)/.git, in which case it outputs simply
.git.  Check for this special case and handle it.

Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-24 02:36:56 -07:00
Shawn O. Pearce
610f043bb3 Import branch 'git-p4' of git://repo.or.cz/fast-export
Simon has asked that the git.git project include the git-p4 project
as at least a contrib/fast-import within git.git.  I think it makes
a lot of sense, as git-p4 nicely complements the only other in-tree
fast-import user: import-tars.perl.

git-p4 is offered under the MIT license by its authors.
2007-06-22 19:16:22 -04:00
Shawn O. Pearce
92d7c8e37b Avoid src:dst syntax as default bash completion for git push
Raimund Bauer just discovered that the default bash completion for
a local branch name in a git-push line is not the best choice when
the branch does not exist on the remote system.

In the past we have always completed the local name 'test' as
"test:test", indicating that the destination name is the same as
the local name.  But this fails when "test" does not yet exist on
the remote system, as there is no "test" branch for it to match
the name against.

Fortunately git-push does the right thing when given just the
local branch, as it assumes you want to use the same name in the
destination repository.  So we now offer "test" as the completion
in a git-push line, and let git-push assume that is also the remote
branch name.

We also still support the remote branch completion after the :,
but only if the user manually adds the colon before trying to get
a completion.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-06-22 18:44:04 -04:00
Simon Hausmann
9ceab36375 Make it possible to specify the HEAD for the internal findUpstreamBranchPoint function.
This isn't used right now in git-p4 but I use it in an external script that loads git-p4 as module.

Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-06-22 00:00:34 +02:00
Simon Hausmann
09d89de2e3 Added git-p4 branches command that shows the mapping of perforce depot paths to imported git branches.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-06-20 23:13:20 +02:00
Simon Hausmann
1a2edf4e8d Warn about conflicting p4 branch mappings and use the first one found.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-06-17 15:10:24 +02:00
Simon Hausmann
6555b2ccfe Fix the branch mapping detection to be independent from the order of the "p4 branches" output.
Collect "unknown" source branches separately and register them at the end.

Also added a minor speed up to splitFilesIntoBranches by breaking out of the loop through all branches when it's safe.

Signed-off-by: Simon Hausmann <simon@lst.de>
2007-06-17 11:25:59 +02:00
Benjamin Sergeant
da4a660161 git-p4 fails when cloning a p4 depo.
A perforce command with all the files in the repo is generated to get
all the file content.
Here is a patch to break it into multiple successive perforce command
who uses 4K of parameter max, and collect the output for later.

It works, but not for big depos, because the whole perforce depo
content is stored in memory in P4Sync.run(), and it looks like mine is
bigger than 2 Gigs, so I had to kill the process.

[Simon: I added the bit about using SC_ARG_MAX, as suggested by Han-Wen]

Signed-off-by: Benjamin Sergeant <bsergean@gmail.com>
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-06-16 22:06:06 +02:00
Simon Hausmann
3c699645f5 Fix initial multi-branch import.
The list of existing p4 branches in git wasn't initialized.

Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-06-16 13:09:21 +02:00
Aneesh Kumar K.V
1be846f6e4 gitview: run blame with -C -C
pass -C -C option to git-blame so that blame browsing
works when the data is copied over from other files.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-13 02:14:26 -07:00
Aneesh Kumar K.V
30a844874d gitview: Fix the blame interface.
The async reading from the pipe was skipping some of the
input lines. Fix the same by making sure that we add the
partial content of the previous read to the newly read
data.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-13 02:14:20 -07:00
Marius Storm-Olsen
cbae7080a7 Only use double quotes on Windows
Signed-off-by: Marius Storm-Olsen <mstormo_git@storm-olsen.com>
2007-06-12 15:27:52 +02:00
Simon Hausmann
d7e3868cdf Fix git-p4 rebase to detect the correct upstream branch instead of unconditionally
always rebasing on top of remotes/p4/master

Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-06-12 14:34:46 +02:00
Simon Hausmann
27d2d8119b Moved the code from git-p4 submit to figure out the upstream branch point
into a separate helper method.

Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-06-12 14:31:59 +02:00
Simon Hausmann
e6b711f00e git-p4 submit: Fix missing quotes around p4 commands to make them work with spaces in filenames
Noticed by Alex Riesen

Signed-off-by: Simon Hausmann <simon@lst.de>
2007-06-11 23:41:41 +02:00
Simon Hausmann
81b462a629 Mention remotes/p4/master also in the documentation.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-06-11 23:30:23 +02:00
Simon Hausmann
a9d1a27af1 Provide some information for single branch imports where the commits go
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-06-11 23:28:03 +02:00
Kevin Green
c3bf3f1301 git-p4: check for existence of repo dir before trying to create
When using git-p4 in this manner:

git-p4 clone //depot/path/project myproject

If "myproject" already exists as a dir, but not a valid git repo, it fails
to create the directory.

Signed-off-by: Kevin Green <Kevin.Green@morganstanley.com>
2007-06-11 23:15:38 +02:00
Simon Hausmann
6581de096e Write out the options tag in the log message of imports only if we actually have
options

Signed-off-by: Simon Hausmann <simon@lst.de>
2007-06-11 10:01:58 +02:00
Simon Hausmann
a43ff00c7c Fix support for explicit disabling of syncing with the origin
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-06-11 09:59:27 +02:00
Simon Hausmann
86fda6a327 Fix depot-paths encoding for multi-path imports (don't split up //depot/path/foo)
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-06-11 08:54:45 +02:00
Simon Hausmann
6e5295c4d3 Fix project name guessing
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-06-11 08:50:57 +02:00
Simon Hausmann
cae7b732d8 Fix updating/creating remotes/p4/* heads from origin/p4/*
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-06-10 10:57:40 +02:00
Simon Hausmann
7aded26ce8 Fixed the check to make sure to exclude the HEAD symbolic refs when updating
the remotes/p4 branches from origin.

Signed-off-by: Simon Hausmann <simon@lst.de>
2007-06-10 00:22:30 +02:00
Han-Wen Nienhuys
5265bfcb06 also strip p4/ from local imports.
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2007-06-08 19:31:49 -03:00
Han-Wen Nienhuys
69d8cc8b99 Merge branch 'master' of git://repo.or.cz/fast-export 2007-06-08 18:19:23 -03:00
Han-Wen Nienhuys
1b9a46849a print error message when p4 print fails (eg. due to permission problems)
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2007-06-08 18:19:16 -03:00
Michael Ellerman
225696af2c gitview: Define __slots__ for Commit
Define __slots__ for the Commit class. This reserves space in each Commit
object for only the defined variables. On my system this reduces heap usage
when viewing a kernel repo by 12% ~= 55868 KB.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-08 02:37:18 -07:00
Michael Ellerman
709b148a90 gitview: Use new-style classes
This changes the Commit class to use new-style class, which has
been available since Python 2.2 (Dec 2001).  This is a necessary
step in order to use __slots__[] declaration, so that we can
reduce the memory footprint in the next patch.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-08 02:37:18 -07:00
Simon Hausmann
df450923a2 Only get the expensive branch mapping from the p4 server when not
syncing with the help of an origin remote (which we instead then use
to get new branches from).

Signed-off-by: Simon Hausmann <simon@lst.de>
2007-06-08 08:49:22 +02:00
Simon Hausmann
a3fdd57901 Make git-p4 submit detect the correct reference (origin) branch when
working with multi-branch imports.

Signed-off-by: Simon Hausmann <simon@lst.de>
2007-06-07 22:54:32 +02:00
Simon Hausmann
5e100b5cd7 Make clone behave like git clone by default again.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-06-07 21:52:12 +02:00
Marius Storm-Olsen
c4b33253c2 Exclude the HEAD symbolic ref from the list of known branches
Signed-off-by: Marius Storm-Olsen <mstormo_git@storm-olsen.com>
2007-06-07 15:28:04 +02:00
Marius Storm-Olsen
db775559c2 Fix single branch import into remotes
Signed-off-by: Marius Storm-Olsen <mstormo_git@storm-olsen.com>
2007-06-07 15:13:59 +02:00
Marius Storm-Olsen
98ad4faf95 Fix git-p4 clone (defaultDestination)
Signed-off-by: Marius Storm-Olsen <mstormo_git@storm-olsen.com>
2007-06-07 15:08:33 +02:00
Marius Storm-Olsen
f7baba8b09 Ensure that the commit message is Windows formated (CRLF) before invoking the editor.
(The default editor on Windows (Notepad) doesn't handle Unix line endings)

Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
2007-06-07 14:11:15 +02:00
Simon Hausmann
a52d5c7bc0 Fix depot-path determination for git-p4 submit
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-06-07 13:10:20 +02:00
Simon Hausmann
b0d10df77a Fix git-p4 submit
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-06-07 13:09:14 +02:00
Simon Hausmann
68c4215306 Fix git-p4 rebase
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-06-07 12:51:03 +02:00
Simon Hausmann
6509e19cd1 Hack to make the multi-branch import work again with self.depotPaths now that
self.depotPath is gone

Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-06-07 09:41:53 +02:00
Simon Hausmann
330f53b8d6 Don't attempt to set the initialParent on multi-branch imports (useless).
At some point the code paths should be unified, but for now I need a working
git-p4 :)

Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-06-07 09:39:51 +02:00
Simon Hausmann
583e170706 Fix common path "calculation" from logs of multiple branches.
Need to use min instead of max for prev/cur to avoid out-of-bounds
string access. Also treat "i" as index of the last match instead of
a length because in case of a complete match of the two strings
i was off by one.

Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-06-07 09:37:13 +02:00
Simon Hausmann
845b42cb6c Fix support for "depot-path" in older git-p4 imports
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-06-07 09:19:34 +02:00
Junio C Hamano
a6080a0a44 War on whitespace
This uses "git-apply --whitespace=strip" to fix whitespace errors that have
crept in to our source files over time.  There are a few files that need
to have trailing whitespaces (most notably, test vectors).  The results
still passes the test, and build result in Documentation/ area is unchanged.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-07 00:04:01 -07:00
Han-Wen Nienhuys
7530a40ce2 look for 'text' and 'binary' files.
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2007-06-05 20:29:59 -03:00
Han-Wen Nienhuys
b1ce944726 thinko: really ignore deleted files.
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2007-05-31 14:21:58 -03:00
Han-Wen Nienhuys
b17f88b544 remove debug print
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2007-05-31 12:40:24 -03:00
Han-Wen Nienhuys
86dff6b676 Cleanups & import into p4/master for local import
- import into master/local if --import-local is set

- use Die() for exiting

- if --verbose is set, raise Exception()

- use joined strings iso. `list` for progress printing

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2007-05-31 12:38:30 -03:00
Han-Wen Nienhuys
d2c6dd30ef use p4CmdList() to get file contents in Python dicts. This is more robust.
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2007-05-31 11:29:25 -03:00
Han-Wen Nienhuys
f2eda79f69 only run p4 print if necessary
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2007-05-30 18:50:41 -03:00
Han-Wen Nienhuys
982bb8a303 don't p4 print deleted files.
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2007-05-30 17:33:18 -03:00
Han-Wen Nienhuys
96e07dd23c read files before creating the commit.
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2007-05-30 16:57:59 -03:00
Han-Wen Nienhuys
a3287be5bc thinko.
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2007-05-30 16:38:32 -03:00
Han-Wen Nienhuys
183b8ef89b store p4 user cache in home directory.
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2007-05-30 16:35:32 -03:00
Han-Wen Nienhuys
9320da8dd4 Thinko, fix buglet.
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2007-05-30 16:22:57 -03:00
Han-Wen Nienhuys
6a49f8e2e0 Read p4 files in one batch.
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2007-05-30 16:21:46 -03:00
Han-Wen Nienhuys
b86f73782e remove global .gitdir
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2007-05-30 13:58:19 -03:00
Han-Wen Nienhuys
5e926eed9f Merge origin. 2007-05-30 13:46:25 -03:00
Han-Wen Nienhuys
bb6e09b27a Diverse cleanups
- print commands with \n

- extractDepotPathsAndChangeFromGitLog -> extractSettings, returning
dict.

- store keepRepoPath in [git-p4: ] line

- create a main() function, so git-p4 can be pychecked

- use --destination for clone destination. This simplifies logic
for --keep-path

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2007-05-30 13:44:15 -03:00
Shawn O. Pearce
2e4aef5893 Allow contrib new-workdir to link into bare repositories
On one particular system I like to keep a cluster of bare Git
repositories and spawn new-workdirs off of them.  Since the bare
repositories don't have working directories associated with them
they don't have a .git/ subdirectory that hosts the repository we
are linking to.

Using a bare repository as the backing repository for a workdir
created by this script does require that the user delete core.bare
from the repository's configuration file, so that Git auto-senses
the bareness of a repository based on pathname information, and
not based on the config file.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-29 00:27:21 -07:00
Simon Hausmann
cfeb59be25 Fix typo in listExistingP4Branches that broke sync.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-28 19:24:57 +02:00
Simon Hausmann
9226c03c32 In *_pipe print the command that failed if it fails.
Fixed old calls to mypopen.

Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-28 19:23:19 +02:00
Han-Wen Nienhuys
6326aa5866 Extract multiple paths concurrently.
This enables importing just the interesting bits of large
repositories.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2007-05-28 12:50:04 -03:00
Han-Wen Nienhuys
4addad2291 add --verbose to all commands.
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2007-05-28 11:45:26 -03:00
Han-Wen Nienhuys
b25b20656d use strip() iso. slicing for removing \n
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2007-05-28 11:20:50 -03:00
Han-Wen Nienhuys
b76f0565bf use string.strip() iso. slicing.
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2007-05-28 11:19:10 -03:00
Han-Wen Nienhuys
8b41a97f8a clone and sync --keep-path to keep perforce path to module.
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2007-05-28 11:18:31 -03:00
Han-Wen Nienhuys
6754a299d8 minor cleanups
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2007-05-28 11:17:27 -03:00
Han-Wen Nienhuys
bce4c5fc0b cleanup
- use re.sub() iso. if for stripping ...
- spacing nits

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2007-05-28 11:15:43 -03:00
Han-Wen Nienhuys
b016d39756 Robustness fixes for pipes
- add read_pipe(), read_pipe_lines(), write_pipe(), which
check pipe.close()

- use throughout

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2007-05-28 11:15:29 -03:00
Simon Hausmann
c8cbbee980 Fix my email address, this isn't really KDE related :)
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-28 14:43:25 +02:00
Han-Wen Nienhuys
7cb5cbefd2 rename apply() to applyCommit(); apply is a python builtin
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2007-05-28 14:29:11 +02:00
Han-Wen Nienhuys
cebdf5af31 reformatting: break long lines.
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2007-05-28 14:28:58 +02:00
Han-Wen Nienhuys
ce6f33c835 Cleanups
- don't use dir (python builtin)
- use re for munging depotPath into destination

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
2007-05-28 14:22:53 +02:00
Simon Hausmann
a3c55c09ec Fix creation of refs/remotes/p4/HEAD symbolic ref
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-27 15:48:01 +02:00
Simon Hausmann
cb4f1280dd Added git-p4 submit --trust-me-like-a-fool for the adventurous users :)
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-25 22:34:30 +02:00
Simon Hausmann
877db584aa Forgot to remove this TODO item when I made --with-origin the default :)
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-25 19:43:38 +02:00
Simon Hausmann
d414c74afd Shortcut the case where we have no origin branch
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-25 11:36:42 +02:00
Simon Hausmann
01265103fe Make --with-origin the default for syncing.
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-25 10:36:10 +02:00
Simon Hausmann
417a7a6fc8 Make --with-origin also work without origin :)
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-25 10:28:46 +02:00
Simon Hausmann
4280e53333 Make git-p4 work with packed refs (don't use os.path.exists to check for the
existance of a ref)

Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-25 08:49:18 +02:00
Simon Hausmann
65c5f3e3f2 Avoid creating non-p4 branches in remotes/p4 off of remotes/origin
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-25 08:44:41 +02:00
Simon Hausmann
10f880f8d4 Oops, fix --with-origin to /really/ also call git fetch :)
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-24 22:28:28 +02:00
Simon Hausmann
abcd790fe9 Added support for --with-origin with multi-branch imports
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-24 22:25:36 +02:00
Simon Hausmann
2cc58fd99a Forgot to remove this return statement from debugging
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-24 22:10:40 +02:00
Simon Hausmann
d1874ed33b Fix creating the remotes/p4 branches based on origin/* for the multi-branch import
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-24 21:23:04 +02:00
Marius Storm-Olsen
c1f9197f37 Replace \r\n with \n when importing from p4 on Windows
Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
2007-05-24 14:17:29 +02:00
Shawn O. Pearce
12977705b3 Update bash completion for git-config options
A few new configuration options grew out of the woodwork during the
1.5.2 series.  Most of these are pretty easy to support a completion
of, so we do so.

I wanted to also add completion support for the <driver> part of
merge.<driver>.name but to do that we have to look at all of the
.gitattributes files and guess what the unique set of <driver>
strings would be.  Since this appears to be non-trivial I'm punting
on it at this time.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-24 02:07:45 -04:00
Shawn O. Pearce
8f87fae645 Teach bash completion about recent log long options
(Somewhat) recently git-log learned about --reverse (to show commits
in the opposite order) and a looong time ago I think it learned
about --raw (to show the raw diff, rather than a unified diff).
These are both useful options, so we should make them easy for the
user to complete.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-24 01:51:30 -04:00
Shawn O. Pearce
fb72759b7d Teach bash completion about 'git remote update'
Recently the git-remote command grew an update subcommand, which
can be used to execute git-fetch across multiple repositories
in a single step.  These can be configured with the 'remotes.*'
configuration options, so we can offer completion for any name that
matches and appears to be useful to git-remote update.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-24 01:46:49 -04:00
Shawn O. Pearce
c70680ce7c Update bash completion header documentation
1) Added a note about supporting the long options for most commands,
    as we have been doing so for quite some time.

 2) Include a notice that these routines are covered by the GPL,
    as that may not be obvious, even though they are distributed
    as part of the core Git distribution.

 3) Added a short section on how to send patches to the routines,
    and to whom they should get sent to.  Currently that is me,
    as I am the active maintainer.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-24 01:36:46 -04:00
Shawn O. Pearce
bfbd131f52 Remove a duplicate --not option in bash completion
This was just me being silly; I put the --not option into the
completion list twice.  There's no duplicates shown in the shell
as the shell removes them before showing them to the user.  But we
really don't need the duplicates in the source script either.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-24 01:26:58 -04:00
Shawn O. Pearce
1fd6bec9bc Teach bash completion about git-shortlog
We've had completion for git-log for quite some time, but just
today I noticed we don't have it for the new builtin shortlog
that runs git-log internally.  This is indeed a handy thing to
have completion for, especially when your branch names are of
the Very-Very-Long-and-Hard/To-Type/Variety/That-Some-Use.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-24 01:25:34 -04:00
Shawn O. Pearce
5cfb4fe525 Hide the plumbing diff-{files,index,tree} from bash completion
The diff-* programs are meant to be plumbing for the diff frontend;
most end users aren't invoking these commands directly.  Consequently
we should avoid showing them as possible completions.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-24 01:10:15 -04:00
Simon Hausmann
ebd8116870 Load the user map from p4 only once at run-time.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-24 00:24:52 +02:00
Simon Hausmann
b3fd1b2808 Fix multi-branch import with --silent.
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-23 23:53:14 +02:00
Simon Hausmann
ad192f2888 Fix p4 execution in git-p4 rollback.
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-23 23:44:19 +02:00
Simon Hausmann
66a2f52395 Catch p4 errors in rollback early enough (before deleting refs!)
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-23 23:40:48 +02:00
Simon Hausmann
ac3e0d79ee Oops, fill the /list/ correct with the p4 exit code.
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-23 23:32:32 +02:00
Simon Hausmann
a6d5da36af Don't make len(p4Cmd("p4 changes -m 1 //foo/...")) == 0 succeed when the p4 command itself failed.
When the p4 command failed write out the exit code in the returned dict.

Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-23 23:29:01 +02:00
Simon Hausmann
0c66a78393 Make rollback work with locally imported branches
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-23 20:07:57 +02:00
Simon Hausmann
65d2ade95e Avoid calling git symbolic-ref refs/heads/p4//HEAD (double slash)
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-23 16:41:46 +02:00
Simon Hausmann
a396b29267 Doc updates
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-23 00:33:34 +02:00
Simon Hausmann
57284050a8 Use refs/heads/* instead of refs/heads/p4/* for local imports
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-23 00:15:50 +02:00
Simon Hausmann
01a9c9c5a8 Added support for --max-changes=<count> to ease import debugging
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-23 00:07:35 +02:00
Simon Hausmann
a028a98e9a Added support for importing multiple branches into refs/heads instead of just refs/remotes
using --import-local. Needs some further microfix but seems to work otherwise.

Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-23 00:03:08 +02:00
Simon Hausmann
52102d4784 Fixes for rollback, delete branches that did not exist at the specified p4 change
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-21 23:44:24 +02:00
Simon Hausmann
af8da89cb7 Fix branch detection in multi-branch imports
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-21 23:25:51 +02:00
Simon Hausmann
5834684d51 Added a rollback command for debugging. It sets back the heads of the p4 branches to the specified p4 change number or earlier.
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-21 22:57:06 +02:00
Simon Hausmann
7944f1425c Make git-p4 submit --direct safer by also creating a git commit
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-21 11:04:26 +02:00
Simon Hausmann
cbf5efa61a Detect with git-p4 submit --direct when there are no changes in the working directory
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-21 10:08:11 +02:00
Simon Hausmann
faf1bd2026 Fix git symbolic-ref warning on initial clone
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-21 10:05:30 +02:00
Simon Hausmann
dc52403696 Fix error detection with git-p4 submit when the requested depot path is not in the client view.
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-21 09:34:56 +02:00
Simon Hausmann
33be3e6550 Fix conversion from old style heads/p4 to remotes/p4/master
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-21 08:44:16 +02:00
Jonas Fonseca
56d99c67d1 Update bash completion to ignore some more plumbing commands
[sp: Modified Jonas' original patch to keep checkout-index
 as a a valid completion.]

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-21 02:09:26 -04:00
Simon Hausmann
341dc1c179 Improved output for multi branch imports and noted another little todo item
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-21 00:39:16 +02:00
Simon Hausmann
b1561ee256 Another (potentially life-saving) idea for submit --direct
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-20 23:52:51 +02:00
Simon Hausmann
24f7b53fdd Had an idea for debugging, record it :)
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-20 23:42:22 +02:00
Simon Hausmann
8a5fc95b43 Specifying --detect-branches is now only needed for the initial clone/sync.
Afterwards it's turned on implicitly if more p4 branches than remotes/p4/master
are found.

Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-20 23:39:40 +02:00
Simon Hausmann
c1b296b9f1 Added support for git-p4 submit --direct (experimental)
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-20 16:55:05 +02:00
Simon Hausmann
47a130b7bf Use git format-patch and git apply --apply when extracting patches from git and
applying them to a Perforce checkout. This should make it possible to apply git
commits with binary files that cannot be handled by path.

Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-20 16:33:21 +02:00
Simon Hausmann
64ffb06a9c Oops, not only /set/ gitdir on clone, also set it /correctly/ :)
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-20 15:24:01 +02:00
Simon Hausmann
59fa417109 Fix gitdir not being set when cloning. Needed for writing the p4 users cache.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-20 15:15:34 +02:00
Simon Hausmann
b607e71efd Cache the output of "p4 users" for faster syncs on high latency links.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-20 10:55:54 +02:00
Simon Hausmann
9bda3a8556 Removed unused variable, more cleanups
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-19 12:05:40 +02:00
Simon Hausmann
71b112d4a4 More cleanups and speedups for labels and branches
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-19 11:54:11 +02:00
Simon Hausmann
d5904674d1 Cleanup/speed up the branch<> file split and removed change range limitation that I added
for debugging (oops).

Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-19 11:07:32 +02:00
Simon Hausmann
29bdbac1cd More work on the incremental importing of multiple branches.
Improved error detection by checking the exit code of git-fast-import.

Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-19 10:23:12 +02:00
Simon Hausmann
8f9b2e082b Give branches a nice project prefix and don't bail out on clone if we failed
to detect the master branch.

Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-18 22:13:26 +02:00
Simon Hausmann
4b97ffb1e4 Started rewriting the branch detection, based on "p4 branches" and "p4 branch -o foo".
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-18 21:45:23 +02:00
Simon Hausmann
66c6a9b559 Removed unused cache variables.
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-18 20:39:38 +02:00
Simon Hausmann
05094f987c Fix branch setup after initial clone.
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-18 20:32:35 +02:00
Simon Hausmann
71bd9bacec Removed todo item that is implemented :)
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-17 22:22:26 +02:00
Simon Hausmann
ef48f9093c Added support for git-p4 sync/rebase --with-origin. See git-p4.txt for details :)
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-17 22:17:49 +02:00
Simon Hausmann
48df6fd850 Bite the bullet and automatically convert old style refs/heads/p4 repositories
to the new style refs/remotes/p4 branching.

Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-17 21:18:53 +02:00
Simon Hausmann
c6d44cb1a1 Changed the default p4 import branch to be refs/remotes/p4/{HEAD,master}
instead of refs/heads/p4.

Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-17 20:57:05 +02:00
Simon Hausmann
8ead4fda3f Create the origin based import branch using git update-ref instead of git branch
so that it's possible to have the import branch in refs/remotes.

Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-17 20:26:58 +02:00
Simon Hausmann
1c9d393d30 Removed ancient and unused code to find the last imported revision from previous imports
to use for the current import by looking at the p4 tags. The current approach of using
the log message works better.

Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-17 20:15:47 +02:00
Simon Hausmann
8a2820def4 Removed cleantags command. It doesn't have any meaning anymore.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-17 19:44:50 +02:00
Simon Hausmann
463e8af655 Clean up code duplication for revision parsing and fix previous commit to not
import into remotes/p4 (yet!).

Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-17 09:13:54 +02:00
Simon Hausmann
f9162f6a4c Always pass a sha1 for the initial parent so that git-fast-import doesn't think
it's creating a new branch from itself. It's a sensible error in general but
in the case of incremental imports we have to apply force :)

Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-17 09:09:05 +02:00
Simon Hausmann
5c4153e488 Fixing syncing (gitdir discovery / cd) for bare repositories
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-17 07:42:38 +02:00
Junio C Hamano
fdcb769916 Merge branch 'maint'
* maint:
  format-patch: add MIME-Version header when we add content-type.
  Fixed link in user-manual
  import-tars: Use the "Link indicator" to identify directories
  git name-rev writes beyond the end of malloc() with large generations
  Documentation/branch: fix small typo in -D example
2007-05-16 12:43:05 -07:00
Johannes Schindelin
df8cfac815 import-tars: Use the "Link indicator" to identify directories
Earlier, we used the mode to determine if a name was associated with
a directory. This fails, since some tar programs do not set the mode
correctly. However, the link indicator _has_ to be set correctly.

Noticed by Chris Riddoch.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-16 14:54:22 -04:00
Simon Hausmann
ca0affe7bb A little todo note before I forget it :), based on a suggestion from Lars.
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-16 13:15:34 +02:00
Simon Hausmann
dc1a93b6dc Fix calling git-p4 rebase from within a subdirectory (git rebase wants to be in toplevel)
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-16 12:12:39 +02:00
Simon Hausmann
c3c4624451 Give a better hint if git-p4 submit fails
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-16 09:43:13 +02:00
Simon Hausmann
d336c15835 Added the possibility of skipping patches during git-p4 submit
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-16 09:41:46 +02:00
Simon Hausmann
81f2373f89 Make git-p4 work with bare repositories.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-15 23:06:43 +02:00
Simon Hausmann
cd6cc0d318 Fix git-p4 clone //depot/project (head import)
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-15 16:15:26 +02:00
Marius Storm-Olsen
95962f318e Make the command call silent
Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
2007-05-15 16:07:41 +02:00
Simon Hausmann
42890f6291 Converted to unix newlines
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-05-15 16:07:02 +02:00
Simon Hausmann
25df95cce4 Make submitting work on Windows.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-05-15 15:15:07 +02:00
Simon Hausmann
caace11112 Make sure all popen calls use binary mode (for Windows) and
also make gitBranchExists work on Windows.

Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-05-15 15:15:07 +02:00
Simon Hausmann
ac1fde55a7 Added a little .bat wrapper from Marius
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-05-15 14:44:32 +02:00
Simon Hausmann
0848358055 Use the subprocess module instead of popen2 to make it work on Windows.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-05-15 14:27:56 +02:00
Junio C Hamano
ffcc952b33 Merge branch 'maint'
* maint:
  Fix documentation of tag in git-fast-import.txt
  Properly handle '0' filenames in import-tars
2007-05-10 14:48:04 -07:00
Shawn O. Pearce
d966e6aa66 Properly handle '0' filenames in import-tars
Randal L. Schwartz pointed out multiple times that we should be
testing the length of the name string here, not if it is "true".
The problem is the string '0' is actually false in Perl when we
try to evaluate it in this context, as '0' is 0 numerically and
the number 0 is treated as a false value.  This would cause us
to break out of the import loop early if anyone had a file or
directory named "0".

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-07 21:13:40 -04:00
Simon Hausmann
a844b7406f Document some implementation details, for the curious... :)
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-07 20:14:17 +02:00
Shawn O. Pearce
db81e67a7d Merge branch 'gfi-maint' into gfi-master
* gfi-maint:
  Teach import-tars about GNU tar's @LongLink extension.
2007-05-02 13:24:10 -04:00
Johannes Schindelin
775477aa1d Teach import-tars about GNU tar's @LongLink extension.
This extension allows GNU tar to process file names in excess of the 100
characters defined by the original tar standard. It does this by faking a
file, named '././@LongLink' containing the true file name, and then adding
the file with a truncated name. The idea is that tar without this
extension will write out a file with the long file name, and write the
contents into a file with truncated name.

Unfortunately, GNU tar does a lousy job at times. When truncating results
in a _directory_ name, it will happily use _that_ as a truncated name for
the file.

An example where this actually happens is gcc-4.1.2, where the full path
of the file WeThrowThisExceptionHelper.java truncates _exactly_ before the
basename. So, we have to support that ad-hoc extension.

This bug was noticed by Chris Riddoch on IRC.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-02 13:22:34 -04:00
Simon Hausmann
2835925139 Cleanup, removed the old tagging code
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-01 23:26:19 +02:00
Simon Hausmann
8f8725314d cleanup, renamed self.globalPrefix to self.depotPath
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-01 23:23:00 +02:00
Simon Hausmann
1c094184da Micro cleanup
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-01 23:15:48 +02:00
Simon Hausmann
ff5dba20e3 Doc cleanups.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-05-01 18:28:38 +02:00
Junio C Hamano
39231b1c32 Merge branch 'maint'
* maint:
  http.c: Fix problem with repeated calls of http_init
  Add missing reference to GIT_COMMITTER_DATE in git-commit-tree documentation
  Fix import-tars fix.
  Update .mailmap with "Michael"
  Do not barf on too long action description
  Catch empty pathnames in trees during fsck
  Don't allow empty pathnames in fast-import
  import-tars: be nice to wrong directory modes
  git-svn: Added 'find-rev' command
  git shortlog documentation: add long options and fix a typo
2007-04-29 01:52:43 -07:00
Junio C Hamano
d0c32b6339 Fix import-tars fix.
This heeds advice from our resident Perl expert to make sure
the script is not confused with a string that ends with /\n

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-29 01:34:59 -07:00
Johannes Schindelin
87859f3443 import-tars: be nice to wrong directory modes
Some tars seem to have modes 0755 for directories, not 01000755. Do
not generate an empty object for them, but ignore them.

Noticed by riddochc on IRC.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-04-28 20:01:36 -04:00
Andy Parkins
c855195cd0 post-receive-email example hook: sed command for getting description was wrong
The sed command that extracted the first line of the project description
didn't include the -n switch and hence the project name was being
printed twice.  This was ruining the email header generation because it
was assumed that the description was only one line and was included in
the subject.  This turned the subject into a two line item and
prematurely finished the header.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-26 20:59:55 -07:00
Andy Parkins
024e5b31af post-receive-email example hook: detect rewind-only updates and output sensible message
Sometimes a non-fast-forward update doesn't add new commits, it merely
removes old commits.  This patch adds support for detecting that and
outputting a more correct message.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-26 20:59:49 -07:00
Andy Parkins
8e404f82ab post-receive-email example hook: fastforward should have been fast_forward
Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-26 20:58:04 -07:00
Junio C Hamano
61397d4b8d Merge branch 'master' of git://repo.or.cz/git/fastimport
* 'master' of git://repo.or.cz/git/fastimport:
  fast-import: size_t vs ssize_t
  fix importing of subversion tars
  Don't repack existing objects in fast-import
2007-04-24 22:02:38 -07:00
Uwe Kleine-König
46f6178a3f fix importing of subversion tars
add a / between the prefix and name fields of the tar archive if prefix
is non-empty.

Signed-off-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-04-24 12:14:40 -04:00
Josh Triplett
2122591b3b Add clean.requireForce option, and add -f option to git-clean to override it
Add a new configuration option clean.requireForce.  If set, git-clean will
refuse to run, unless forced with the new -f option, or not acting due to -n.

Signed-off-by: Josh Triplett <josh@freedesktop.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-23 22:13:50 -07:00
Aneesh Kumar K.V
2c9750cc8b gitview: annotation support
List files modifed as a part of the commit in the diff window
Support annotation of the file listed in the diff window
Support history browsing in the annotation window.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-20 01:46:42 -07:00
Alexandre Julliard
413689d36f git.el: Add a commit description to the reflog.
Add a description of the commit to the reflog using the first line of
the log message, the same way the git-commit script does it.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-19 23:27:51 -07:00
Shawn O. Pearce
9398e5aa16 Contribute a fairly paranoid update hook
I'm using a variant of this update hook in a corporate environment
where we perform some validations of the commits and tags that
are being pushed.  The model is a "central repository" type setup,
where users are given access to push to specific branches within
the shared central repository.  In this particular installation we
run a specially patched git-receive-pack in setuid mode via SSH,
allowing all writes into the repository as the repository owner,
but only if this hook blesses it.

One of the major checks we perform with this hook is that the
'committer' line of a commit, or the 'tagger' line of a new annotated
tag actually correlates to the UNIX user who is performing the push.
Users can falsify these lines on their local repositories, but
the central repository that management trusts will reject all such
forgery attempts.  Of course 'author' lines are still allowed to
be any value, as sometimes changes do come from other individuals.

Another nice feature of this hook is the access control lists for
all repositories on the system can also be stored and tracked in
a supporting Git repository, which can also be access controlled
by itself.  This allows full auditing of who-had-what-when-and-why,
thanks to git-blame's data mining capabilities.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-19 23:27:09 -07:00
Simon Hausmann
51a2640afd Handle patch errors in git-p4 submit better.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-04-15 09:59:56 +02:00
Simon Hausmann
90865adc01 A new attempt at fixing the child-fast-import-process-not-finished race condition
in the clone command

Signed-off-by: Simon Hausmann <simon@lst.de>
2007-04-15 09:34:15 +02:00
Simon Hausmann
5e80dd4d7e Slightly improved formatting of the raw_input questions.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-04-14 16:09:43 +02:00
Simon Hausmann
8b72ca0f76 Removed the old patch apply code from git-p4 submit.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-04-14 16:05:54 +02:00
Simon Hausmann
f291b4e3d4 Fix the timezone formatting. Now qgit also displays (parses) it correctly.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-04-14 11:21:50 +02:00
Simon Hausmann
fd4ca86a0b Print an error message of some sort if git fast-import fails.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-04-13 22:21:10 +02:00
Simon Hausmann
80b5910fac Allow for convenient rebasing after git-p4 submit
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-04-09 12:43:40 +02:00
Simon Hausmann
7243b350b3 Added a simple example of usage to the "documentation" :)
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-04-08 10:21:56 +02:00
Simon Hausmann
10c3211b81 fix variable usage (oops)
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-04-08 10:15:47 +02:00
Simon Hausmann
c45b1cfe1e Fix file determination for #head imports
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-04-08 10:13:32 +02:00
Simon Hausmann
f9a3a4f796 Added git-p4 clone convenience command
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-04-08 10:08:26 +02:00
Simon Hausmann
68ed351ab5 Honor --silent for labels
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-04-08 09:00:55 +02:00
Simon Hausmann
cb53e1f8e9 Turn off potentially slow label detection by default
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-04-08 00:12:02 +02:00
Simon Hausmann
1f52af6c73 Provide a tree summary after git-p4 rebase
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-04-08 00:07:02 +02:00
Simon Hausmann
01ce1fe967 Added git-p4 rebase convenience
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-04-07 23:46:50 +02:00
Junio C Hamano
77e6f5bc10 Merge branch 'maint'
* maint:
  Fix lseek(2) calls with args 2 and 3 swapped
  Honor -p<n> when applying git diffs
  Fix dependency of common-cmds.h
  Fix renaming branch without config file
  DESTDIR support for git/contrib/emacs
  gitweb: Fix bug in "blobdiff" view for split (e.g. file to symlink) patches
  Document --left-right option to rev-list.
  Revert "builtin-archive: use RUN_SETUP"
  rename contrib/hooks/post-receieve-email to contrib/hooks/post-receive-email.
  rerere: make sorting really stable.
  Fix t4200-rerere for white-space from "wc -l"
2007-04-05 16:34:51 -07:00
Ville Skyttä
1e31fbe24f DESTDIR support for git/contrib/emacs
make install DESTDIR=... support for git/contrib/emacs

Signed-off-by: Ville Skyttä <scop@xemacs.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-05 14:14:55 -07:00
Gerrit Pape
5850cb645d rename contrib/hooks/post-receieve-email to contrib/hooks/post-receive-email.
$ git grep post-receieve-email
 $ git grep post-receive-email
 templates/hooks--post-receive:#. /usr/share/doc/git-core/contrib/hooks/post-receive-email
 $

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-04 22:17:59 -07:00
Simon Hausmann
711544b00c Clean up python class names.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-04-01 15:40:46 +02:00
Simon Hausmann
2a9489c024 Fix "compilation" :)
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-04-01 13:39:39 +02:00
Xavier Maillard
3cc5ca3923 git-blame.el: pick a set of random colors for each git-blame turn
I thought it would be cool to have different set of colors for each
git-blame-mode. Function `git-blame-new-commit' does this for us
picking when possible, a random colors based on the set we build on
startup. When it fails, `git-blame-ancient-color' will be used. We
also take care not to use the same color more than once (thank you
David Kågedal, really).

* Prevent (future possible) namespace clash by renaming `color-scale'
into `git-blame-color-scale'. Definition has been changed to be more
in the "lisp" way (thanks for help to #emacs). Also added a small
description of what it does.

* Added docstrings at some point and instructed defvar when a variable
was candidate to customisation by users.

* Added missing defvar to silent byte-compilers (git-blame-file,
git-blame-current)

* Do not require 'cl at startup

* Added more informations on compatibility

Signed-off-by: Xavier Maillard <zedek@gnu.org>
Acked-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-31 23:58:10 -07:00
Xavier Maillard
02f0559eba git-blame.el: separate git-blame-mode to ease maintenance
git-blame-mode has been splitted into git-blame-mode-on and
git-blame-mode-off; it now conditionnaly calls one of them depending
of how we call it. Code is now easier to maintain and to understand.

Fixed `git-reblame' function: interactive form was at the wrong
place.

String displayed on the mode line is now configurable through
`git-blame-mode-line-string` (default to " blame").

Signed-off-by: Xavier Maillard <zedek@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-31 23:58:10 -07:00
Julian Phillips
4f01748d51 contrib/workdir: add a simple script to create a working directory
Add a simple script to create a working directory that uses symlinks
to point at an exisiting repository.  This allows having different
branches in different working directories but all from the same
repository.

Based on a description from Junio of how he creates multiple working
directories[1].  With the following caveat:

"This risks confusion for an uninitiated if you update a ref that
is checked out in another working tree, but modulo that caveat
it works reasonably well."

[1] http://article.gmane.org/gmane.comp.version-control.git/41513/

Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-31 01:26:28 -07:00
Andy Parkins
4557e0de5b Reimplement emailing part of hooks--update in contrib/hooks/post-receive-email
The update hook is no longer the correct place to generate emails; there
is now the hooks/post-receive script which is run automatically after a
ref has been updated.

This patch is to make use of that new location, and to address some
faults in the old update hook.

The primary problem in the conversion was that in the update hook, the
ref has not actually been changed, but is about to be.  In the
post-receive hook the ref has already been updated.  That meant that
where we previously had lines like:

 git rev-list --not --all

would now give the wrong list because "--all" in the post-receive hook
includes the ref that we are making the email for.  This made it more
difficult to show only the new revisions added by this update.

The solution is not pretty; however it does work and doesn't need any
changes to git-rev-list itself.  It also fixes (more accurately: reduces
the likelihood of) a nasty race when another update occurs while this
script is running.  The solution, in short, looks like this (see the
source code for a longer explanation)

 git rev-parse --not --all | grep -v $(git rev-parse $refname) |
 git rev-list --pretty --stdin $oldrev..$newrev

This uses git-rev-parse followed by grep to filter out the revision of
the ref in question before it gets to rev-list and inhibits the output
of itself.  By using $(git rev-parse $revname) rather than $newrev as the
filter, it also takes care of the situation where another update to the
same ref has been made since $refname was $newrev.

The second problem that is addressed is that of tags inhibiting the
correct output of an update email.  Consider this, with somebranch and
sometag pointing at the same revision:

 git push origin somebranch
 git push origin sometag

That would work fine; the push of the branch would generate an email
containing all the new commits introduced by the update, then the push
of the tag would generate the shortlog formatted tag email.  Now
consider:

 git push origin sometag
 git push origin somebranch

When some branch comes to run its "--not --all" line, it will find
sometag, and filter those commits from the email - leaving nothing.
That meant that those commits would not show (in full) on any email.
The fix is to not use "--all", and instead use "--branches" in the
git-rev-parse command.

Other changes
 * Lose the monstrous one-giant-script layout and put things in easy to
   digest functions.  This makes it much easier to find the place you
   need to change if you wanted to customise the output.  I've also
   tried to write more verbose comments for the same reason.  The hook
   script is big, mainly because of all the different cases that it has
   to handle, so being easy to navigate is important.
 * All uses of "git-command" changed to "git command", to cope better
   if a user decided not to install all the hard links to git;
 * Cleaned up some of the English in the email
 * The fact that the receive hook makes the ref available also allows me
   to use Shawn Pearce's fantastic suggestion that an annotated tag can
   be parsed with git-for-each-ref.  This removes the potentially
   non-portable use of "<<<" heredocs and the nasty messing around with
   "date" to convert numbers of seconds UTC to a real date
 * Deletions are now caught and notified (briefly)
 * To help with debugging, I've retained the command line mode from the
   update hook; but made it so that the output is not emailed, it's just
   printed to the screen.  This could then be redirected if the user
   wanted
 * Removed the "Hello" from the beginning of the email - it's just
   noise, and no one seriously has their day made happier by "friendly"
   programs
 * The fact that it doesn't rely on repository state as an indicator any
   more means that it's far more stable in its output; hopefully the
   same arguments will always generate the same email - even if the
   repository changes in the future.  This means you can easily recreate
   an email should you want to.
 * Included Jim Meyering's envelope sender option for the sendmail call
 * The hook is now so big that it was inappropriate to copy it
   to every repository by keeping it in the templates directory.
   Instead, I've put a comment saying to look in contrib/hooks, and
   given an example of calling the script from that template hook.  The
   advantage of calling the script residing at some fixed location is
   that if a future package of git included a bug fixed version of the
   script, that would be picked up automatically, and the user would not
   have to notice and manually copy the new hook to every repository
   that uses it.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-31 01:21:18 -07:00
Simon Hausmann
c9b50e6307 Fix the docs for git-p4 submit and turn git-p4 submit --master=foo into
simply git-p4 submit mytopicbranch.

Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-29 19:15:24 +02:00
Simon Hausmann
a46668faf7 Fix variable usage in tag import
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-28 17:05:38 +02:00
Alexandre Julliard
b704e589f4 git.el: Display some information about the HEAD commit.
Use git-log --pretty=oneline to print a short description of the
current HEAD (and merge heads if any) in the buffer header.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-27 12:52:41 -07:00
Simon Hausmann
1f4ba1cbfc Added support for mapping p4 labels to git tags
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-26 22:34:34 +02:00
Simon Hausmann
8910ac0e88 git-p4 debug doesn't need a git repository
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-26 08:18:55 +02:00
Simon Hausmann
e20a9e530a Don't try to parse any options with git-p4 debug but pass it straight on to p4
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-03-26 00:13:51 +02:00
Simon Hausmann
9863f4055e Prefer git command over git-command.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-03-24 16:35:05 +01:00
Simon Hausmann
274917a3d6 Minor cosmetic fixlet for the git-p4 submit sync question.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-03-24 09:18:20 +01:00
Simon Hausmann
cb2c9db507 Different versions of p4 have different output for the where command ;(
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-03-24 09:15:11 +01:00
Simon Hausmann
967f72e21b Use the new incremental import style by default
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-03-23 09:30:41 +01:00
Simon Hausmann
9512497bcf Make it possible to run git-p4 submit from within the git repository
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-23 09:16:07 +01:00
Simon Hausmann
179caebff4 Brand new smart incremental import that doesn't need tags or git repo-config :)
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-03-22 22:17:42 +01:00
Simon Hausmann
569d1bd409 Set the default branch in run, not in the constructor
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-03-22 21:34:16 +01:00
Simon Hausmann
8136a6399c Helper function to check the existance of a revision
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-03-22 21:27:14 +01:00
Simon Hausmann
6ae8de88f5 Added some helper function(s) to parse the depot path and change number from the log message
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-03-22 21:10:25 +01:00
Simon Hausmann
f5816a5522 Changed the default branch for imports from "master" to "p4"
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-03-22 20:36:28 +01:00
Simon Hausmann
a559b289bd Changed the format of the imported log message slightly, so that it's easier to parse again.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-03-22 20:27:41 +01:00
Simon Hausmann
e7f0d0d9b9 Removed the .py extension from git-p4 as it's annoying to type every time.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-22 09:15:32 +01:00
Simon Hausmann
53150250b1 Don't show the submit template and the diff first in less but show it in $editor right away
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-03-21 21:04:12 +01:00
Simon Hausmann
2061865005 Make it possible to invoke git-p4 from within subdirectories of a git working tree.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-21 13:05:30 +01:00
Simon Hausmann
1932a6ac7c Made --apply-as-patch the default for git-p4 submit as it's significantly faster.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-21 11:01:18 +01:00
Simon Hausmann
5d0b6042d4 Fix support for deletions in git-p4 submit when using --apply-as-patch by filtering out deletions in the diff-tree output.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-21 10:57:54 +01:00
Simon Hausmann
04219c04b7 Added experimental but super-fast --apply-as-patch option to git-p4 submit
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-21 10:11:20 +01:00
Simon Hausmann
b4aa8d12b4 Documentation enhancements.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-03-21 08:27:33 +01:00
Simon Hausmann
0b69b46925 Start of the git-p4 documentation.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-20 22:41:00 +01:00
Simon Hausmann
c5fdcbcc20 Removed p4-fast-export and p4-git-sync as they've been integrated into git-p4 now.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-20 22:09:27 +01:00
Simon Hausmann
c715706b15 Fixed the initial version import by getting the file index correct by correctly skipping deleted files.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-20 21:13:49 +01:00
Simon Hausmann
0828ab1403 Added missing "self"s to make the script evaluate correctly.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-20 20:59:30 +01:00
Simon Hausmann
b984733c80 Completely untested "merge" of p4-fast-export.py into git-p4.py
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-20 20:54:23 +01:00
Simon Hausmann
05140f342e sync-to-perforce is now called submit and fixed the gitdir check a little bit
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-20 18:32:47 +01:00
Shawn O. Pearce
3e993bb657 contrib/continuous: a continuous integration build manager
This is a simple but powerful continuous integration build system
for Git.  It works by receiving push events from repositories
through the post-receive hook, aggregates them on a per-branch
basis into a first-come-first-serve build queue, and lets a
background build daemon perform builds one at a time.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-19 22:21:19 -07:00
Simon Hausmann
83dce55af3 Part of the code is copyright by Trolltech ASA.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-19 22:26:36 +01:00
Simon Hausmann
4f5cf76a55 First (untested) attempt at migrating p4-git-sync into the final git-p4 script
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-19 22:25:17 +01:00
Simon Hausmann
c8c3911685 Provide a little bit of help description for the git-p4 "tools".
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-19 21:02:30 +01:00
Simon Hausmann
86949eef40 Start moving the git-p4 tools into one single script.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-19 20:59:12 +01:00
Simon Hausmann
95d27cb75d Pass the right number of arguments to commit, fixes single-branch imports.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-19 12:04:37 +01:00
Simon Hausmann
09e16455e0 Improved the git dir detection.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-19 11:57:10 +01:00
Alexandre Julliard
d55552f6e3 git.el: Add support for commit hooks.
Run the pre-commit and post-commit hooks at appropriate places, and
display their output if any.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-19 01:40:27 -07:00
James Bowes
6757ada403 Make gc a builtin.
Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-17 00:34:19 -07:00
Simon Hausmann
228d36c92b Default to interactive syncing
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-16 13:47:46 +01:00
Simon Hausmann
f72537f97e Use p4 revert ... instead of revert -a ... after submitting, to make sure the p4 checkout is clean.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-15 19:07:06 +01:00
Simon Hausmann
d566209e7f Auto-detect the current git branch before submitting back to perforce.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-03-14 23:30:23 +01:00
Simon Hausmann
4d9e5fcea6 Ignore Apple resource files when importing from perforce to git.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-03-14 19:03:16 +01:00
Simon Hausmann
d7873afdf4 Be nice and use /usr/bin/env python for the git-p4 scripts
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-14 17:33:46 +01:00
Simon Hausmann
794a913a00 Automatically operate on a temporary branch, needed for cherry-pick to work when applying changes to
files that are deleted in the future.
Also do some Perforce cleaning

Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-14 17:31:47 +01:00
Simon Hausmann
09a14fb524 Lots of bugfixes to p4-git-sync.
Added interactive and dry-run mode.

Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-13 16:36:10 +01:00
Simon Hausmann
5aba82fd50 Fix git-dir option and allow reading log substitutions from a file
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-13 09:14:45 +01:00
Simon Hausmann
0bcff6121d First version of a new script to submit changes back to perforce from git repositories.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-12 23:00:34 +01:00
Junio C Hamano
ed287ab7fa Merge branch 'maint'
* maint:
  git.el: Retrieve commit log information from .dotest directory.
  git.el: Avoid appending a signoff line that is already present.
  setup_git_directory_gently: fix off-by-one error
  user-manual: install user manual stylesheet with other web documents
  user-manual: fix rendering of history diagrams
  user-manual: fix missing colon in git-show example
  user-manual: fix inconsistent use of pull and merge
  user-manual: fix inconsistent example
  glossary: fix overoptimistic automatic linking of defined terms
  Documentation: s/seperator/separator/
  Adjust reflog filemode in shared repository
2007-03-10 22:07:26 -08:00
Alexandre Julliard
60fa08ed61 git.el: Retrieve commit log information from .dotest directory.
If a git-am or git-rebase is in progress, fill the commit log buffer
from the commit information found in the various files in the .dotest
directory.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-10 21:58:26 -08:00
Alexandre Julliard
3844814755 git.el: Avoid appending a signoff line that is already present.
Also avoid inserting an extra newline if other signoff lines are
present.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-10 21:58:21 -08:00
Simon Hausmann
4fe2ca17f7 Split up the cache commandline options into (command) cache and data cache.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-10 21:30:24 +01:00
Simon Hausmann
dd87020bd3 Reduce the number of false "merges" by skipping "branch from" entries in the integrated output as well as by ignoring integrations of future (newer) changes.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-10 21:23:49 +01:00
Simon Hausmann
43cc31e8a2 More work on branch detection by implementing changeIsBranchMerge().
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-10 17:46:49 +01:00
Simon Hausmann
85a8f1ac3b More code cleanups and preparations for more branch detection heuristics.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-10 11:46:26 +01:00
Simon Hausmann
478764bc82 Minor code cleanups.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-10 10:53:07 +01:00
Simon Hausmann
59f1d2b52d Make the p4 data/command cache configurable through the --cache-debug commandline option.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-03-10 10:25:34 +01:00
Simon Hausmann
a0f22e996c Fixed p4-debug file extension.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-03-10 09:49:19 +01:00
Simon Hausmann
934371385c Changed --known-branches to take a file as argument instead of a comma separated list.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-08 21:34:40 +01:00
Simon Hausmann
3ef674bd4b Work in progress on detecting branches.
Added a disk-cache p4 output so debugging imports is faster.
Added --known-branches commandline option for pre-defining branches.
Various other fixes...

Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-08 21:27:59 +01:00
Simon Hausmann
6392a40e5e Adjust the output parsing of git name-rev to handle the output of the latest git version.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-03-07 19:58:54 +01:00
Xavier Maillard
5ced057221 contrib/emacs: Use non-interactive function to byte-compile files
Add git-blame as a candidate to the byte-compilation.

batch-byte-compile is the prefered way to byte-compile files in
batch mode. Use it instead of the interactive function.

Signed-off-by: Xavier Maillard <zedek@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-05 00:45:57 -08:00
Junio C Hamano
1db8b60b2a Merge branch 'maint'
* maint:
  Start preparing Release Notes for 1.5.0.3
  Documentation: git-remote add [-t <branch>] [-m <branch>] [-f] name url
  Include config.mak in doc/Makefile
  git.el: Set the default commit coding system from the repository config.
  git-archimport: support empty summaries, put summary on a single line.
  http-push.c::lock_remote(): validate all remote refs.
  git-cvsexportcommit: don't cleanup .msg if not yet committed to cvs.
2007-02-28 14:18:57 -08:00
Alexandre Julliard
14b4f2dbd1 git.el: Set the default commit coding system from the repository config.
If not otherwise specified, take the default coding system for commits
from the 'i18n.commitencoding' repository configuration value.

Also set the buffer-file-coding-system variable in the log buffer to
make the selected coding system visible on the modeline.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-28 12:39:14 -08:00
Junio C Hamano
c4f8f82755 Merge branch 'maint'
* maint:
  builtin-fmt-merge-msg: fix bugs in --file option
  index-pack: Loop over pread until data loading is complete.
  blameview: Fix the browse behavior in blameview
  Fix minor typos/grammar in user-manual.txt
  Correct ordering in git-cvsimport's option documentation
  git-show: Reject native ref
  Fix git-show man page formatting in the EXAMPLES section
2007-02-27 22:15:42 -08:00
Aneesh Kumar
ae64860622 blameview: Fix the browse behavior in blameview
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-27 21:41:48 -08:00
Simon Hausmann
5ea919de22 Don't print a plain newline at the end of the execution (avoids bogus cron error mails).
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-02-22 10:20:53 +01:00
Simon Hausmann
47e33ec082 More work in --silent support.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-22 09:22:36 +01:00
Simon Hausmann
161958cc2f Added support for --silent so that p4-fast-export can be called from cronjobs.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-22 09:03:39 +01:00
Junio C Hamano
2470653196 Merge branch 'maint'
* maint:
  Use gunzip -c over gzcat in import-tars example.
  git-gui: Don't crash in citool mode on initial commit.
  git-gui: Remove TODO list.
  git-gui: Include browser in our usage message.
  git-gui: Change summary of git-gui.
  git-gui: Display all authors of git-gui.
  git-gui: Use mixed path for docs on Cygwin.
  git-gui: Correct crash when saving options in blame mode.
  git-gui: Expose the browser as a subcommand.
  git-gui: Create new branches from a tag.
  git-gui: Prefer version file over git-describe.
  git-gui: Print version on the console.
  git-gui: More consistently display the application name.
  git-gui: Permit merging tags into the current branch.
  git-gui: Basic version check to ensure git 1.5.0 or later is used.
  git-gui: Refactor 'exec git subcmd' idiom.
2007-02-21 11:16:20 -08:00
Simon Hausmann
9c9fec3d28 Added p4 delete behavioural emulation as todo item.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-21 17:51:07 +01:00
Michael Loeffler
c750da256a Use gunzip -c over gzcat in import-tars example.
Not everyone has gzcat or bzcat installed on their system, but
gunzip -c and bunzip2 -c perform the same task and are available
if the user has installed gzip support or bzip2 support.

Signed-off-by: Michael Loeffler <zvpunry@zvpunry.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-02-21 11:09:57 -05:00
Simon Hausmann
90dc3dfdc8 Fix single-branch imports by skipping the branch/merge detection correctly.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-18 01:18:22 +10:00
Simon Hausmann
f1e9b5345e Use sets.Set() instead of set() to run also with older versions of Python.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-15 02:16:14 +10:00
Simon Hausmann
0563a4538a Make it possible to specify the p4 changes to import through a text file (for debugging) and made various improvements to the branch/merge heuristic detection.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-14 17:13:17 +01:00
Junio C Hamano
4cc41a16c1 Remove git-diff-stages.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-12 19:33:03 -08:00
Junio C Hamano
207dfa0791 Remove git-resolve.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-12 19:33:03 -08:00
Aneesh Kumar K.V
07fef5fc15 blameview: Move the commit info to a pane below the blame window.
Also spawn the the new blameview in the background

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-12 19:20:08 -08:00
Simon Hausmann
930d3cc94e When trying to map p4 integrations to git merges just record it as a single merge with the newest p4 change as secondary parent.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-02-12 22:05:21 +01:00
Simon Hausmann
77083daac7 Set git fast-import marks for every imported change for future use.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-02-12 21:56:46 +01:00
Simon Hausmann
53b03239aa After marking a p4 branch as merged don't ever merge it in git again.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-02-12 21:44:02 +01:00
Simon Hausmann
dcacf8b447 More fixes in heuristic p4 branch detection based on common path components.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-02-12 21:41:45 +01:00
Simon Hausmann
766887e110 Started work on p4 branch detection (experimental!).
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-02-12 21:04:59 +01:00
Simon Hausmann
44b3add651 Code cleanups.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-02-12 20:28:58 +01:00
Michael Loeffler
d63ea11594 import-tars: brown paper bag fix for file mode.
There is a bug with this $git_mode variable which should be 0644
or 0755, but nothing else I think.

Signed-off-by: Michael Loeffler <zvpunry@zvpunry.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-02-12 12:19:45 -05:00
Shawn O. Pearce
c6ec3b13b8 bash: Hide git-fast-import.
The new git-fast-import command is not intended to be invoked
directly by an end user.  So offering it as a possible completion
for a subcommand is not very useful.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-02-11 19:55:22 -05:00
Simon Hausmann
12d04ca7da Cleanups, remove unused variable.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-02-11 21:35:34 +01:00
Simon Hausmann
fc21f8a1da Create lightweight git tags (using the "reset" trick) for the incremental import instead of full-blown ones. Also fix parsing the output of git name-rev for figuring out the last imported p4 change number.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-02-11 18:04:39 +01:00
Simon Hausmann
f7d63b0c99 Added a little helper script to remove unused tags from the perforce import.
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-02-10 10:26:03 +01:00
Simon Hausmann
fe2193183a Changed the default git import branch from "p4" to "master".
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-02-10 10:05:51 +01:00
Simon Hausmann
8718f3ec9a Avoid the excessive use of git tags for every perforce change and instead just create one git tag for the last imported change.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-02-10 10:05:29 +01:00
Simon Hausmann
b41507a427 Minor code cleanups.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-02-10 09:25:22 +01:00
Nicolas Pitre
ad34a028c1 remove mailmap.linux
This file is incomplete, unmaintained, and it doesn't belong in the GIT
package anyway.

A more complete version is already included in the Linux -mm tree and
is about to make its way into mainline RSN.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-09 12:14:40 -08:00
David Kågedal
d2589855df git-blame.el: Autoupdate while editing
This adds the support for automatically updating the buffer while editing.
A configuration variable git-blame-autoupdate controls whether this should
be enabled or not.

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-09 00:52:53 -08:00
David Kågedal
96df551cb8 git-blame.el: Doc fixes and cleanup
Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-09 00:52:53 -08:00
David Kågedal
f0f39bb4c4 git-blame.el: blame unsaved changes
Make git-blame use the current buffer contents for the blame, instead of
the saved file.  This makes the blame correct even if there are unsaved
changes.

Also added a git-reblame command.

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-09 00:52:53 -08:00
David Kågedal
fa88211600 git-blame.el: improve color handling
Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-09 00:52:52 -08:00
David Kågedal
9f85fb324d Handle uncommitted changes and cache descriptions
Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-09 00:52:52 -08:00
Jakub Narebski
f6f125fbaa git-blame: Change installation instructions
Change installation instructions to using either "(require 'git-blame)"
or appropriate autoload instruction in GNU Emacs init file, .emacs
This required adding "(provide 'git-blame)" at the end of git-blame.el
and adding [preliminary] docstring to `git-blame-mode' function for
consistency (to mark function as interactive in `autoload' we have to
provide docstring as DOCSTRING is third arg, and INTERACTIVE fourth,
and both are optional).  `git-blame-mode' is marked to autoload.

While at it ensure that we add `git-blame-mode' to `minor-mode-alist'
only once (in a way that does not depend on `cl' package).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-09 00:52:52 -08:00
Jakub Narebski
b52ba1a5d6 git-blame: Add Emacs Lisp file headers and GNU GPL boilerplate
Add Emacs Lisp file headers, according to "Coding Conventions" chapter
in Emacs Lisp Reference Manual and Elisp Area Convetions for
EmacsWiki:
  http://www.emacswiki.org/cgi-bin/wiki/ElispAreaConventions
Those include: copyright notice, GNU GPL boilerplate, description and
instalation instructions as provided in email and in commit message
introducing git-blame.el, compatibility notes from another email by
David Kågedal about what to change to use it in GNU Emacs 20, and
"git-blame ends here" to detect if file was truncated.  First line
includes setting file encoding via first line local variable values
(file variables).

Added comment to "(require 'cl)" to note why it is needed; "Coding
Conventions" advises to avoid require the `cl' package of Common Lisp
extensions at run time.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-09 00:52:52 -08:00
Junio C Hamano
05b07ab963 Merge branch 'master' of git://repo.or.cz/git/fastimport
* 'master' of git://repo.or.cz/git/fastimport:
  tar archive frontend for fast-import.
  Correct spelling of fast-import in docs.
  Correct some language in fast-import documentation.
  Correct ^0 asciidoc syntax in fast-import docs.
2007-02-08 15:47:08 -08:00
Simon Hausmann
20c7bc76b9 Added a little helper script to debug the output of the p4 python interface.
Signed-off-by: Simon Hausmann <simon@lst.de>
2007-02-08 23:00:19 +01:00
Shawn O. Pearce
590dd4bfd2 tar archive frontend for fast-import.
This is an example fast-import frontend, in less than 100 lines
of Perl.  It accepts one or more tar archives on the command line,
passes them through gzcat/bzcat/zcat if necessary, parses out the
individual file headers and feeds all contained data to fast-import.
No temporary files are involved.

Each tar is treated as one commit, with the commit timestamp coming
from the oldest file modification date found within the tar.

Each tar is also tagged with an annotated tag, using the basename
of the tar file as the name of the tag.

Currently symbolic links and hard links are not handled by the
importer.  The file checksums are also not verified.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-02-08 15:37:53 -05:00
Simon Hausmann
c9c527d7b6 Made the name of the git branch used for the perforce import configurable through a new --branch=<name> commandline option.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-08 15:53:11 +01:00
Simon Hausmann
7315866824 Catch io exceptions from git fast-import again and print the error message.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-08 15:45:16 +01:00
Simon Hausmann
1e30c07dfc Fix calculation of the newest imported revision for #head imports.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-07 23:51:51 +01:00
Simon Hausmann
23efd2545b Make specifying the revision ranges more convenient.
Added support for @all as revision range specifier to import all changes to a given depot path.
Also default to an import of #head if no revrange is specified.

Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-07 23:37:54 +01:00
Simon Hausmann
1cd573866a Make incremental imports easier to use by storing the p4 depot path after an import in .git/config and re-using it when we're invoked again later.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-07 23:25:56 +01:00
Simon Hausmann
e3d37cf098 Fixed incremental imports by using the correct "from" command instead of "merge" with git fast-import.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-07 23:09:49 +01:00
Simon Hausmann
c4cf2d4f87 Minor cleanups and print an error message of git fast-import if it fails.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-07 22:57:01 +01:00
Junio C Hamano
a7fd83b0b0 Remove contrib/colordiff
This has completely been superseded by built-in --color option.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-06 16:33:16 -08:00
Shawn O. Pearce
88293c675c bash: Complete git-remote subcommands.
Completing the 3 core subcommands to git-remote, along with the
names of remotes for 'show' and 'prune' (which take only existing
remotes) is handy.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-05 19:09:40 -08:00
Shawn O. Pearce
c5650b0840 bash: Support git-rebase -m continuation completion.
Apparently `git-rebase -m` uses a metadata directory within .git
(.git/.dotest-merge) rather than .dotest used by git-am (and
git-rebase without the -m option).  This caused the completion code
to not offer --continue, --skip or --abort when working within a
`git-rebase -m` session.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-05 19:09:40 -08:00
David Kågedal
28389d45fb git-blame: an Emacs minor mode to view file with git-blame output.
Here's another version of git-blame.el that automatically tries to
create a sensible list of colors to use for both light and dark
backgrounds.  Plus a few minor fixes.

To use:

  1) Load into emacs: M-x load-file RET git-blame.el RET
  2) Open a git-controlled file
  3) Blame: M-x git-blame-mode

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-05 14:22:28 -08:00
Stelian Pop
98d47d4ccf Add hg-to-git conversion utility.
hg-to-git.py  is able to convert a Mercurial repository into a git one,
and preserves the branches in the process (unlike tailor)

hg-to-git.py can probably be greatly improved (it's a rather crude
combination of shell and python) but it does already work quite well for
me. Features:
	- supports incremental conversion
	  (for keeping a git repo in sync with a hg one)
	- supports hg branches
	- converts hg tags

Signed-off-by: Stelian Pop <stelian@popies.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-05 13:52:45 -08:00
Aneesh Kumar K.V
3fb624521e blameview: Support browsable functionality to blameview.
Double clicking on the row execs a new blameview with commit hash
as argument.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-05 13:49:00 -08:00
Shawn O. Pearce
b2e69f6299 bash: Support git-bisect and its subcommands.
We now offer completion support for git-bisect's subcommands,
as well as ref name completion on the good/bad/reset subcommands.
This should make interacting with git-bisect slightly easier on
the fingers.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-05 13:49:00 -08:00
Shawn O. Pearce
1b71eb35dd bash: Support --add completion to git-config.
We've recently added --add as an argument to git-config, but I
missed putting it into the earlier round of git-config updates
within the bash completion.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-05 13:49:00 -08:00
Shawn O. Pearce
e459415c9c bash: Hide git-resolve, its deprecated.
Don't offer resolve as a possible subcommand completion.  If you
read the top of the script, there is a big warning about how it
will go away soon in the near future.  People should not be using it.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-05 13:49:00 -08:00
Shawn O. Pearce
b26c87488f bash: Offer --prune completion for git-gc.
I'm lazy.  I don't want to type out --prune if bash can do it for
me with --<tab>.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-05 13:49:00 -08:00
Shawn O. Pearce
983591c31e bash: Hide diff-stages from completion.
Apparently nobody really makes use of git-diff-stages, as nobody
has complained that it is not supported by the git-diff frontend.
Since its likely this will go away in the future, we should not
offer it as a possible subcommand completion.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-05 13:49:00 -08:00
Shawn O. Pearce
d8a9fea5ea bash: Support completion on git-cherry.
I just realized I did not support ref name completion for git-cherry.
This tool is just too useful to contributors who submit patches
upstream by email; completion support for it is very handy.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-05 13:49:00 -08:00
Shawn O. Pearce
ec80489132 bash: Support internal revlist options better.
format-patch/log/whatchanged all take --not and --all as options
to the internal revlist process.  So these should be supported
as possible completions.

gitk takes anything rev-list/log/whatchanged takes, so we should
use complete_revlist to handle its options.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-04 00:18:41 -08:00
Shawn O. Pearce
b3391775e8 bash: Support unique completion when possible.
Because our use of -o nospace prevents bash from adding a trailing space
when a completion is unique and has been fully completed, we need to
perform this addition on our own.  This (large) change converts all
existing uses of compgen to our wrapper __gitcomp which attempts to
handle this by tacking a trailing space onto the end of each offered
option.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-04 00:18:41 -08:00
Shawn O. Pearce
78d4d6a281 bash: Support unique completion on git-config.
In many cases we know a completion will be unique, but we've disabled
bash's automatic space addition (-o nospace) so we need to do it
ourselves when necessary.

This change adds additional support for new configuration options
added in 1.5.0, as well as some extended completion support for
the color.* family of options.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-04 00:18:41 -08:00
Shawn O. Pearce
a925c6f165 bash: Classify more commends out of completion.
Most of these commands are not ones you want to invoke from the
command line on a frequent basis, or have been renamed in 1.5.0 to
more friendly versions, but the old names are being left behind to
support existing scripts in the wild.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-04 00:18:41 -08:00
Shawn O. Pearce
72e5e989b8 bash: Add space after unique command name is completed.
Because we use the nospace option for our completion function for
the main 'git' wrapper bash won't automatically add a space after a
unique completion has been made by the user.  This has been pointed
out in the past by Linus Torvalds as an undesired behavior.  I agree.

We have to use the nospace option to ensure path completion for
a command such as `git show` works properly, but that breaks the
common case of getting the space for a unique completion.  So now we
set IFS=$'\n' (linefeed) and add a trailing space to every possible
completion option.  This causes bash to insert the space when the
completion is unique.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-04 00:18:41 -08:00
Shawn O. Pearce
8435b54848 bash: Complete long options to git-add.
The new --interactive mode of git-add can be very useful, so users
will probably want to have completion for it.

Likewise the new git-add--interactive executable is actually a
plumbing command.  Its invoked by `git add --interactive` and is
not intended to be invoked directly by the user.  Therefore we
should hide it from the list of available Git commands.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-04 00:18:41 -08:00
Shawn O. Pearce
2e3a430a9a bash: Classify cat-file and reflog as plumbing.
Now that git-show is capable of displaying any file content from any
revision and is the approved Porcelain-ish level method of doing so,
cat-file should no longer be classified as a user-level utility by
the bash completion package.

I'm also classifying the new git-reflog command as plumbing for the
time being as there are no subcommands which are really useful to
the end-user.  git-gc already invokes `git reflog expire --all`,
which makes it rather unnecessary for the user to invoke it directly.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-04 00:18:41 -08:00
Shawn O. Pearce
9f4cc6f76b bash: Remove short option completions for branch/checkout/diff.
The short options (-l, -f, -d) for git-branch are rather silly to
include in the completion generation as these options must be fully
typed out by the user and most users already know what the options
are anyway, so including them in the suggested completions does
not offer huge value.  (The same goes for git-checkout and git-diff.)

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-04 00:18:41 -08:00
Simon Hausmann
6d48d12f5d Initial support for importing a directory from Perforce at a specified revision.
Use p4 files //depot/path/...@revision to determine the state of the project and create a "fake" git commit from it.

Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-01 18:19:55 +01:00
Simon Hausmann
68f1336fe3 Code cleanups, move the code to create a commit with fast-import into a separate function out of the main loop.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-01 17:42:23 +01:00
Simon Hausmann
f16255f559 Simplify the incremental import by elimination the need for a temporary import branch.
It turns out that git fast-import can "resume" from an existing branch just fine.

Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-01 08:23:39 +01:00
Simon Hausmann
61b3cf7c47 Started working on incremental imports from Perforce.
Try to find the last imported p4 change number from the git tags and try to pass the right parent for commits to git fast-import.

Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-02-01 00:08:51 +01:00
Simon Hausmann
79799d52b2 Fix file permissions of p4-fast-export.py to be executable.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-01-31 23:09:24 +01:00
Simon Hausmann
71f7c0d0bb Create a git tag for every changeset imported from perforce.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-01-31 23:03:01 +01:00
Simon Hausmann
214bed8239 Fixed displaying import progress by calling flush on stdout.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-01-31 22:47:53 +01:00
Simon Hausmann
f26037dce3 Permit calling p4-fast-export with a depot path that has the typical ... wildcard at the end.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-01-31 22:41:08 +01:00
Simon Hausmann
2385536282 Avoid calling fstat for every imported file (slow!) and instead read the file data first into the python process and use the length of the bytes read for the size field of git fast-import.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-01-31 22:38:07 +01:00
Simon Hausmann
0dd0b9d011 Ported the remaining functions that parsed p4 shell output over to the p4 python interface.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-01-31 22:31:28 +01:00
Simon Hausmann
a39811b46e Instead of parsing the output of "p4 users" use the python objects of "p4 -G users".
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-01-31 22:19:18 +01:00
Simon Hausmann
f6148d9129 Minor code cleanups and ported some p4 interfacing code over to the p4 python mode.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-01-31 22:13:17 +01:00
Simon Hausmann
701ce87633 Changed the import mechanism to write to git fast-import through a pipe instead of having p4-fast-export write to stdout and let the caller connect it to git fast-import.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-01-31 21:54:56 +01:00
Simon Hausmann
3f2ddd47c7 Removed unused p4cat function and added helper function for the perforce python interface (p4Cmd).
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-01-31 20:48:39 +01:00
Simon Hausmann
9466d479e2 Speed up the import of individual files from Perforce into git by passing the output of "p4 print" directly to git fast-import. Also try to set the mode of the file in git correctly based on file type heuristics.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-01-31 20:16:26 +01:00
Simon Hausmann
d93ed31ac4 Some fixes to the timezone conversion between the date of a perforce change and the git commit.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
2007-01-31 19:43:16 +01:00
Simon Hausmann
72b2f0ada3 Implemented basic support for converting the date of the perforce change to the git format. The timezone isn't correctly set up yet though.
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-01-31 16:39:46 +01:00
Simon Hausmann
06bb04454f Slightly improved help usage output and made specifying the trailing slash for the depot path optional.
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-01-31 09:49:41 +01:00
Simon Hausmann
da96cd9e24 Added basic support for specifying the depot path to import from as well as the range of perforce changes.
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-01-31 09:39:20 +01:00
Simon Hausmann
16d6b8ab6f Initial import of a python script to import changesets from Perforce into git.
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
2007-01-31 00:16:59 +01:00
Aneesh Kumar K.V
73a2acc0a0 blameview: Use git-cat-file to read the file content.
Fix blameview to use git-cat-file to read the file content.
This make sure we show the right content when we have modified
file in the working directory which is not committed.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-30 02:32:28 -08:00
Tom Prince
e0d10e1c63 [PATCH] Rename git-repo-config to git-config.
Signed-off-by: Tom Prince <tom.prince@ualberta.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-28 16:16:53 -08:00
Jeff King
cace16fdcb Add a sample program 'blameview' to show how to use git-blame --incremental
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-28 12:53:26 -08:00
Alexandre Julliard
40d6dc0f9d vc-git.el: Take into account the destination name in vc-checkout.
This is necessary for vc-version-other-window. Based on a patch by Sam
Vilain <sam.vilain@catalyst.net.nz>.

Currently, the vc-git-checkout function uses `git checkout' to fetch a
file from the git repository to the working copy.  However, it is
completely ignoring the input argument that specifies the destination
file.  `git-checkout' does not support specifying this, so we have to
use `git-cat-file', capture the output in a buffer and then save it.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-26 15:38:27 -08:00
Sam Vilain
fd73423f01 contrib/emacs/vc-git.el: support vc-version-other-window
Currently, the vc-git-checkout function uses `git checkout' to fetch a
file from the git repository to the working copy.  However, it is
completely ignoring the input argument that specifies the destination
file.  `git-checkout' does not support specifying this, so we have to
use `git-cat-file', capture the output in a buffer and then save it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-25 19:27:03 -08:00
Jeff King
222664e74d contrib/vim: update syntax for changed commit template
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-22 20:40:26 -08:00
Jason Riedy
2aad957a51 Replace "echo -n" with printf in shell scripts.
Not all echos know -n.  This was causing a test failure in
t5401-update-hooks.sh, but not t3800-mktag.sh for some reason.

Signed-off-by: Jason Riedy <ejr@cs.berkeley.edu>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-15 22:23:21 -08:00
Alexandre Julliard
03d311eda2 git.el: Define the propertize function if needed, for XEmacs compatibility.
Also use `concat' instead of `format' in the pretty-printer since
format doesn't preserve properties under XEmacs.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-09 16:15:07 -08:00
Alexandre Julliard
9fa77a51a4 git.el: Avoid setting font lock keywords before entering log-edit mode.
Instead, reinitialize the keywords after the fact. This avoids
conflicts with other users of log-edit mode, like pcl-cvs.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-06 10:45:13 -08:00
Alexandre Julliard
cdc0873a78 git.el: Don't use --info-only when resolving a file.
It doesn't make a difference for git.el, but it helps when interacting
with git-rebase and friends.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-06 10:44:51 -08:00
Junio C Hamano
d2c11a38c4 UTF-8: introduce i18n.logoutputencoding.
It is plausible for somebody to want to view the commit log in a
different encoding from i18n.commitencoding -- the project's
policy may be UTF-8 and the user may be using a commit message
hook to run iconv to conform to that policy (and either not have
i18n.commitencoding to default to UTF-8 or have it explicitly
set to UTF-8).  Even then, Latin-1 may be more convenient for
the usual pager and the terminal the user uses.

The new variable i18n.logoutputencoding is used in preference to
i18n.commitencoding to decide what encoding to recode the log
output in when git-log and friends formats the commit log message.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-27 16:41:33 -08:00
Alexandre Julliard
4de0f9f9b6 vc-git: Ignore errors caused by a non-existent directory in vc-git-registered.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-22 23:14:43 -08:00
Jeff King
ff7f22f36e vim syntax: follow recent changes to commit template
This patch changes the syntax highlighting to correctly match the new
text of the commit message introduced by
  82dca84871

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-18 00:00:15 -08:00
Shawn O. Pearce
9013192449 Teach bash the new features of 'git show'.
Now that 'git show' accepts ref:path as an argument to specify a
tree or blob we should use the same completion logic as we support
for cat-file's object identifier.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-15 22:31:01 -08:00
Andy Parkins
a159ca0cb7 Allow subcommand.color and color.subcommand color configuration
While adding colour to the branch command it was pointed out that a
config option like "branch.color" conflicts with the pre-existing
"branch.something" namespace used for specifying default merge urls and
branches.  The suggested solution was to flip the order of the
components to "color.branch", which I did for colourising branch.

This patch does the same thing for
  - git-log (color.diff)
  - git-status (color.status)
  - git-diff (color.diff)
  - pager (color.pager)

I haven't removed the old config options; but they should probably be
deprecated and eventually removed to prevent future namespace
collisions.  I've done this deprecation by changing the documentation
for the config file to match the new names; and adding the "color.XXX"
options to contrib/completion/git-completion.bash.

Unfortunately git-svn reads "diff.color" and "pager.color"; which I
don't like to change unilaterally.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-13 01:47:36 -08:00
Shawn O. Pearce
67ffa11425 Fix broken bash completion of local refs.
Commit 35e65ecc broke completion of local refs, e.g. "git pull . fo<tab>"
no longer would complete to "foo".  Instead it printed out an internal
git error ("fatal: Not a git repository: '.'").

The break occurred when I tried to improve performance by switching from
git-peek-remote to git-for-each-ref.  Apparently git-peek-remote will
drop into directory "$1/.git" (where $1 is its first parameter) if it
is given a repository with a working directory.  This allowed the bash
completion code to work properly even though it was not handing over
the true repository directory.

So now we do a stat in bash to see if we need to add "/.git" to the
path string before running any command with --git-dir.

I also tried to optimize away two "git rev-parse --git-dir" invocations
in common cases like "git log fo<tab>" as typically the user is in the
top level directory of their project and therefore the .git subdirectory
is in the current working directory.  This should make a difference on
systems where fork+exec might take a little while.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-28 15:48:55 -08:00
Shawn O. Pearce
4548e855e4 Teach bash how to complete long options for git-commit.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-28 15:48:52 -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
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
Johannes Schindelin
d8e812502f 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>
2006-11-19 22:59:05 -08:00
Shawn O. Pearce
a79c6551a3 Remove more sed invocations from within bash completion.
This change removes between 1 and 4 sed invocations per completion
entered by the user.  In the case of cat-file the 4 invocations per
completion can take a while on Cygwin; running these replacements
directly within bash saves some time for the end user.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-05 13:36:38 -08:00
Shawn O. Pearce
e5d5b21fdf Support bash completion on symmetric difference operator.
Now that log, whatchanged, rev-list, etc. support the symmetric
difference operator '...' we should provide bash completion for it
just like we do for '..'.

While we are at it we can remove two sed invocations during the
interactive prompt and replace them with internal bash operations.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-05 13:36:36 -08:00
Shawn O. Pearce
873537fadc Take --git-dir into consideration during bash completion.
If the user has setup a command line of "git --git-dir=baz" then
anything we complete must be performed within the scope of "baz"
and not the current working directory.

This is useful with commands such as "git --git-dir=git.git log m"
to complete out "master" and view the log for the master branch of
the git.git repository.  As a nice side effect this also works for
aliases within the target repository, just as git would honor them.

Unfortunately because we still examine arguments by absolute position
in most of the more complex commands (e.g. git push) using --git-dir
with those commands will probably still cause completion to fail.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-05 13:36:33 -08:00
Shawn O. Pearce
56fc25f21e Bash completion support for remotes in .git/config.
Now that Git natively supports remote specifications within the
config file such as:

	[remote "origin"]
		url = ...

we should provide bash completion support "out of the box" for
these remotes, just like we do for the .git/remotes directory.

Also cleaned up the __git_aliases expansion to use the same form
of querying and filtering repo-config as this saves two fork/execs
in the middle of a user prompted completion.  Finally also forced
the variable 'word' to be local within __git_aliased_command.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-05 13:36:32 -08:00
Shawn O. Pearce
76c3eb51ed Only load .exe suffix'd completions on Cygwin.
The only platform which actually needs to define .exe suffixes as
part of its completion set is Cygwin.  So don't define them on any
other platform.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-05 13:36:30 -08:00
Shawn O. Pearce
144d33dec9 Added missing completions for show-branch and merge-base.
The show-branch and merge-base commands were partially supported
when it came to bash completions as they were only specified in
one form another.  Now we specify them in both forms.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-05 13:36:29 -08:00
Shawn O. Pearce
67e78c3b8a Added bash completion support for git-reset.
Completion for the --hard/--soft/--mixed modes of operation as
well as a ref name for <commit-ish> can be very useful and save
some fingers.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-04 17:17:46 -08:00
Shawn O. Pearce
dfb960920d Added completion support for git-branch.exe.
On Cygwin a user might complete the new git-branch builtin as
git-branch.exe, at which point bash requires a new completion
registration for the command.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-04 17:17:45 -08:00
Alexandre Julliard
2379d61fa6 git.el: Include MERGE_MSG in the log-edit buffer even when not committing a merge.
This lets us take advantage of the fact that git-cherry-pick now saves
the message in MERGE_MSG too.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-04 01:50:35 -08:00
Alexandre Julliard
2ac2b19601 git.el: Move point after the log message header when entering log-edit mode.
Suggested by Han-Wen Nienhuys.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-04 01:50:26 -08:00
Alexandre Julliard
b8ee51815a git.el: Added a function to open the current file in another window.
Bound to 'o' by default, compatible with pcl-cvs and
buffer-mode. Suggested by Han-Wen Nienhuys.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-04 01:50:22 -08:00
Alexandre Julliard
8a078c3f72 git.el: Added functions for moving to the next/prev unmerged file.
This is useful when doing a merge that changes many files with only a
few conflicts here and there.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-11-04 01:50:13 -08:00
Dennis Stosberg
367dce2a5b Bash completion support for aliases
- Add aliases to the list of available git commands.
 - Make completion work for aliased commands.

Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-28 13:36:39 -07:00
Karl Hasselström
b4aee09e61 ignore-errors requires cl
vc-git complains that it can't find the definition of ignore-errors
unless I (require 'cl). So I guess the correct place to do that is in
the file itself.

Signed-off-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-23 01:13:49 -07:00
Karl Hasselström
474a90fef9 git-vc: better installation instructions
Provide some more detailed installation instructions, for the
elisp-challenged among us.

Signed-off-by: Karl Hasselström <kha@treskal.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-22 16:38:32 -07:00
Alexandre Julliard
13f8e0b24b vc-git.el: Switch to using git-blame instead of git-annotate.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-05 09:09:13 -07:00
Alexandre Julliard
c530c5aa31 git.el: Fixed inverted "renamed from/to" message.
The deleted file should be labeled "renamed to" and the added file
"renamed from", not the other way around (duh!)

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-05 02:31:01 -07:00
Junio C Hamano
690d8824c8 Contributed bash completion support for core Git tools.
This is a set of bash completion routines for many of the
popular core Git tools.  I wrote these routines from scratch
after reading the git-compl and git-compl-lib routines available
from the gitcompletion package at http://gitweb.hawaga.org.uk/
and found those to be lacking in functionality for some commands.
Consequently there may be some similarities but many differences.

Since these are completion routines only for tools shipped with
core Git and since bash is a popular shell on many of the native
core Git platforms (Linux, Mac OS X, Solaris, BSD) including these
routines as part of the stock package would probably be convienent
for many users.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-28 02:31:25 -07:00
Jeff King
cdad8bbe92 contrib/vim: add syntax highlighting file for commits
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-13 00:31:58 -07:00
Jonas Fonseca
5bab25fd91 gitview.txt: improve asciidoc markup
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-25 19:26:27 -07:00
Ville Skyttä
076a10c728 Be nicer if git executable is not installed
This patch avoids problems if vc-git.el is installed and activated, but
the git executable is not available, for example
http://list-archive.xemacs.org/xemacs-beta/200608/msg00062.html

Signed-off-by: Ville Skyttä <scop@xemacs.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-16 19:18:27 -07:00
Junio C Hamano
24cf6e5847 Merge branch 'pb/configure'
* pb/configure:
  Rename man1 and man7 variables to man1dir and man7dir
  Allow INSTALL, bindir, mandir to be set in main Makefile
2006-07-26 13:35:35 -07:00
Alexandre Julliard
5df52584fa git.el: Put the git customize group in the 'tools' parent group.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-23 23:36:05 -07:00
Alexandre Julliard
73389f12bf git.el: Try to reuse an existing buffer when running git-status.
By default, running git-status again will now reuse an existing buffer
that displays the same directory. The old behavior of always creating
a new buffer can be obtained by customizing the git-reuse-status-buffer
option.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-23 23:36:03 -07:00
Alexandre Julliard
9f56a7fda9 git.el: Prepend a slash to the file name when adding to .gitignore.
This way the ignore command will really only ignore the marked files
and not files with the same name in subdirectories.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-23 23:35:32 -07:00
Alexandre Julliard
51a6e56fb7 git.el: Run git-rerere on commits if the rr-cache directory exists.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-23 23:35:29 -07:00
Jakub Narebski
5716e794bf Display help for Git mode after pressing h' or ?' in *git-status*
Add bindings for "h" and "?" in git-status-mode to display help about the mode,
including keymap via (describe-function 'git-status-mode), like in PCL-CVS.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-13 21:21:34 -07:00
Jakub Narebski
1b3a667461 Wrap long lines in docstrings in contrib/emacs/git.el
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-13 21:21:27 -07:00
Pavel Roskin
82e5a82fd7 Fix more typos, primarily in the code
The only visible change is that git-blame doesn't understand
"--compability" anymore, but it does accept "--compatibility" instead,
which is already documented.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-10 00:36:44 -07:00
Eric Wong
60d02ccc18 git-svn: migrate out of contrib
Allow NO_SVN_TESTS to be defined to skip git-svn tests.  These
tests are time-consuming due to SVN being slow, and even more so
if SVN Perl libraries are not available.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-06 17:02:47 -07:00
Ville Skytt,Ad(B
b5dd9d2027 Fix print-log and diff compatibility with recent vc versions
Here's a patch that fixes print-log and diff compatibility with recent
vc versions, such as current GNU Emacs CVS.

Signed-off-by: Ville Skytt,Ad(B <scop@xemacs.org>
2006-07-05 16:17:56 -07:00
Eric Wong
4bbf599f7b git-svn: avoid fetching files outside of the URL we're tracking
Thanks to Santi <sbejar@gmail.com> for the bug report and explanation:
> /path/to/repository/project/file
> /path/to/repository/project-2/file
<...>
> you end up with a project with the following files:
>
> file
> -2/file

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-07-05 16:17:47 -07:00
Eric Wong
03e0ea8712 git-svn: allow a local target directory to be specified for init
git-svn init url://to/the/repo local-repo

will create the local-repo dirrectory if doesn't exist yet and
populate it as expected.

Original patch by Luca Barbato, cleaned up and made to work for
the current version of git-svn by me (Eric Wong).

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-30 22:50:47 -07:00
Jakub Narebski
7b8cf0cf29 Rename man1 and man7 variables to man1dir and man7dir
This patch renames man1 and man7 variables to man1dir and man7dir,
according to "Makefile Conventions: Variables for Installation
Directories" in make.info of GNU Make.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-29 23:49:16 -07:00
Jakub Narebski
e14421b9aa Allow INSTALL, bindir, mandir to be set in main Makefile
Makefiles in subdirectories now use existing value of INSTALL, bindir,
mandir if it is set, allowing those to be set in main Makefile or in
included config.mak.  Main Makefile exports variables which it sets.

Accidentally it renames bin to bindir in Documentation/Makefile
(should be bindir from start, but is unused, perhaps to be removed).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-29 23:49:16 -07:00
Eric Wong
80f50749da git-svn: be verbose by default on fetch/commit, add -q/--quiet option
Slower connections can make git-svn look as if it's doing
nothing for a long time; leaving the user wondering if we're
actually doing anything.  Now we print some file progress just
to assure the user that something is going on while they're
waiting.

Added the -q/--quiet option to users to revert to the old method
if they preferred it.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-28 03:20:51 -07:00
Eric Wong
a00439acd2 git-svn: add --follow-parent and --no-metadata options to fetch
--follow-parent:
  This is especially helpful when we're tracking a directory
  that has been moved around within the repository, or if we
  started tracking a branch and never tracked the trunk it was
  descended from.

  This relies on the SVN::* libraries to work.  We can't
  reliably parse path info from the svn command-line client
  without relying on XML, so it's better just to have the SVN::*
  libs installed.

  This also removes oldvalue verification when calling update-ref

  In SVN, branches can be deleted, and then recreated under the
  same path as the original one with different ancestry
  information, causing parent information to be mismatched /
  misordered.

  Also force the current ref, if existing, to be a parent,
  regardless of whether or not it was specified.

--no-metadata:
  This gets rid of the git-svn-id: lines at the end of every commit.

  With this, you lose the ability to use the rebuild command.  If
  you ever lose your .git/svn/git-svn/.rev_db file, you won't be
  able to fetch again, either.  This is fine for one-shot imports.

  Also fix some issues with multi-fetch --follow-parent that were
  exposed while testing this.  Additionally, repack checking is
  simplified greatly.

  git-svn log will not work on repositories using this, either.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-28 03:20:50 -07:00
Eric Wong
27e9fb8d41 git-svn: add the commit-diff command
This is intended for interoperability with git-svnimport.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-28 03:20:50 -07:00
Eric Wong
c1927a8554 git-svn: several graft-branches improvements
The 'graft-branches' command can now analyze tree matches for
merge detection after commits are done, when --branch or
--branch-all-refs options are used.

We ensure that tree joins (--branch and --branch-all-refs
options) during commit time only add SVN parents that occurred
before the commit we're importing

Also fixed branch detection via merge messages, this manner of
merge detection (a la git-svnimport) is really all fuzzy, but at
least it actually works now :)

Add some new tests to go along with these fixes, too.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-28 03:20:50 -07:00
Eric Wong
dc62e25cbd git-svn: SVN 1.1.x library compatibility
Tested on a plain Ubuntu Hoary installation
using subversion 1.1.1-2ubuntu3

1.1.x issues I had to deal with:

* Avoid the noisy command-line client compatibility check if we
  use the libraries.

* get_log() arguments differ (now using a nice wrapper from
  Junio's suggestion)

* get_file() is picky about what kind of file handles it gets,
  so I ended up redirecting STDOUT.  I'm probably overflushing
  my file handles, but that's the safest thing to do...

* BDB kept segfaulting on me during tests, so svnadmin will use FSFS
  whenever we can.

* If somebody used an expanded CVS $Id$ line inside a file, then
  propsetting it to use svn:keywords will cause the original CVS
  $Id$ to be retained when asked for the original file.  As far as
  I can see, this is a server-side issue.  We won't care in the
  test anymore, as long as it's not expanded by SVN, a static
  CVS $Id$ line is fine.

While we're at making ourselves more compatible, avoid grep
along with the -q flag, which is GNU-specific. (grep avoidance
tip from Junio, too)

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-28 03:20:29 -07:00
Eric Wong
ec9d00d078 git-svn: fix commit --edit flag when using SVN:: libraries
Trying to open an interactive editor in the console while stdout is
being piped to the parent process doesn't work out very well.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-22 02:15:16 -07:00
Eric Wong
c07eee1f2a git-svn: fix --rmdir when using SVN:: libraries
When tracking directories with nearly all of its files at
the most nested levels, --rmdir would accidentally go too
far when deleting.

Of course, we'll add a test for this condition, too.

Makefile: automatically run new tests as they appear in t/

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-20 01:31:57 -07:00
Eric Wong
1a82e79315 git-svn: rebuild convenience and bugfixes
We will now automatically fetch the refs/remotes/git-svn ref
from origin and store a Pull: line for it.

--remote=<origin> may be passed if your remote is named something
other than 'origin'

Also, remember to make GIT_SVN_DIR whenever we need to create
.rev_db

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:21 -07:00
Eric Wong
0e8a002c59 git-svn: svn (command-line) 1.0.x compatibility
Tested on a plain Ubuntu Warty installation
using subversion 1.0.6-1.2ubuntu3

svn add --force was never needed, as it only affected
directories, which git (thankfully) doesn't track

The 1.0.x also didn't support symlinks(!), so allow NO_SYMLINK
to be defined for running tests

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:21 -07:00
Eric Wong
86f363791b git-svn: tests no longer fail if LC_ALL is not a UTF-8 locale
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:21 -07:00
Eric Wong
c0d4822268 git-svn: bugfix and optimize the 'log' command
Revisions with long commit messages were being skipped, since
the 'git-svn-id' metadata line was at the end and git-log uses a
32k buffer to print the commits.

Also the last 'git-svn-id' metadata line in a commit is always
the valid one, so make sure we use that, as well.

Made the verbose flag work by passing the correct option switch
('--summary') to git-log.

Finally, optimize -r/--revision argument handling by passing
the appropriate limits to revision

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:21 -07:00
Eric Wong
968bdf1f3d git-svn: Eliminate temp file usage in libsvn_get_file()
This means we'll have a loose object when we encounter a symlink
but that's not the common case.

We also don't have to worry about svn:eol-style when using the
SVN libraries, either.  So remove the code to deal with that.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:21 -07:00
Eric Wong
cf7424b021 git-svn: fix several small bugs, enable branch optimization
Share the repack counter between branches when doing
multi-fetch.

Pass the -d flag to git repack by default.  That's the
main reason we will want automatic pack generation, to
save space and improve disk cache performance.  I won't
add -a by default since it can generate extremely large
packs that make RAM-starved systems unhappy.

We no longer generate the .git/svn/$GIT_SVN_ID/info/uuid
file, either.  It was never read in the first place.

Check for and create .rev_db if we need to during fetch (in case
somebody manually blew away their .rev_db and wanted to start
over.  Mainly makes debugging easier).

Croak with $? instead of $! if there's an error closing pipes

Quiet down some of the chatter, too.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:20 -07:00
Eric Wong
6c5cda89e9 git-svn: avoid creating some small files
repo_path_split() is already pretty fast, and is already
optimized via caching.

We also don't need to create an exclude file if we're
relying on the SVN libraries.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:20 -07:00
Eric Wong
42d328701d git-svn: make the $GIT_DIR/svn/*/revs directory obsolete
This is a very intrusive change, so I've beefed up the tests
significantly.  Added 'full-test' a target to the Makefile,
to test different possible configurations.  This is intended
for maintainers only.  Users should only be concerned with
'test' succeeding.

We now have a very simple custom database format for handling
mapping of svn revisions => git commits.  Of course, we're
not really using it yet, either.

Also disabled automatic branch-finding on new trees for now.
It's too easily broken.  revisions_eq() function should be
helpful for branch detection.

Also removed an extra assertion in fetch_cmd() that wasn't
correctly done.  This bug was found by full-test.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:20 -07:00
Eric Wong
a5e0cedc0a git-svn: add support for Perl SVN::* libraries
This means we no longer have to deal with having bloated SVN
working copies around and we get a nice performance increase as
well because we don't have to exec the SVN binary and start a
new server connection each time.

Of course we have to manually manage memory with SVN::Pool
whenever we can, and hack around cases where SVN just eats
memory despite pools (I blame Perl, too).  I would like to
keep memory usage as stable as possible during long fetch/commit
processes since I still use computers with only 256-512M RAM.

commit should always be faster with the SVN library code.  The
SVN::Delta interface is leaky (or I'm not using it with pools
correctly), so I'm forking on every commit, but that doesn't
seem to hurt performance too much (at least on normal Unix/Linux
systems where fork() is pretty cheap).

fetch should be faster in most common cases, but probably not all.
fetches will be faster where client/server delta generation is
the bottleneck and not bandwidth.  Of course, full-files are
generated server-side via deltas, too.  Full files are always
transferred when they're updated, just like git-svnimport and
unlike command-line svn.  I'm also hacking around memory leaks
(see comments) here by using some more forks.

I've tested fetch with http://, https://, file://, and svn://
repositories, so we should be reasonably covered in terms of
error handling for fetching.

Of course, we'll keep plain command-line svn compatibility as a
fallback for people running SVN 1.1 (I'm looking into library
support for 1.1.x SVN, too).  If you want to force command-line
SVN usage, set GIT_SVN_NO_LIB=1 in your environment.

We also require two simultaneous connections (just like
git-svnimport), but this shouldn't be a problem for most
servers.

Less important commands:

show-ignore is slower because it requires repository
access, but -r/--revision <num> can be specified.

graft-branches may use more memory, but it's a
short-term process and is funky-filename-safe.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:20 -07:00
Eric Wong
79bb8d88fc git-svn: add 'log' command, a facsimile of basic `svn log'
This quick feature should make it easy to look up svn log
messages when svn users refer to -r/--revision numbers.

The following features from `svn log' are supported:

  --revision=<n>[:<n>] - is supported, non-numeric args are not:
			 HEAD, NEXT, BASE, PREV, etc ...
  -v/--verbose         - just maps to --raw (in git log), so
			 it's completely incompatible with
			 the --verbose output in svn log
  --limit=<n>          - is NOT the same as --max-count,
			 doesn't count merged/excluded commits
  --incremental        - supported (trivial :P)

New features:

  --show-commit        - shows the git commit sha1, as well
  --oneline            - our version of --pretty=oneline

Any other arguments are passed directly to `git log'

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:20 -07:00
Eric Wong
7a97de4e19 git-svn: add UTF-8 message test
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:20 -07:00
Eric Wong
9d55b41aad git-svn: add some functionality to better support branches in svn
New commands:

graft-branches - The most interesting command of the bunch.  It
detects branches in SVN via various techniques (currently
regexes and file copies).   It can be later extended to handle
svk and other properties people may use to track merges in svk.
Basically, merge tracking is not standardized at all in the SVN
world, and git grafts are perfect for dealing with this
situation.

Existing branch support (via tree matches) is only handled at
fetch time.

The following tow were originally implemented as shell scripts
several months ago, but I just decided to streamline things a
bit and added them to the main script.

multi-init - supports git-svnimport-like command-line syntax for
importing repositories that are layed out as recommended by the
SVN folks.  This is a bit more tolerant than the git-svnimport
command-line syntax and doesn't require the user to figure out
where the repository URL ends and where the repository path
begins.

multi-fetch - runs fetch on all known SVN branches we're
tracking.  This will NOT discover new branches (unlike
git-svnimport), so multi-init will need to be re-run (it's
idempotent).

Consider these three to be auxilliary commands (like
show-ignore, and rebuild) so their behavior won't receive as
much testing or scrutiny as the core commands (fetch and
commit).

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:20 -07:00
Eric Wong
f8ab6b732f git-svn: add --shared and --template= options to pass to init-db
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:20 -07:00
Eric Wong
dc5869c00d git-svn: add --repack and --repack-flags= options
This should help keep disk usage sane for large imports.

--repack takes an optional argument for the interval, it
defaults to 1000 if no argument is specified.

Arguments to --repack-flags are passed directly to git-repack.
No arguments are passed by default.

Idea stolen from git-cvsimport :)

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:20 -07:00
Eric Wong
b8c92cadda git-svn: minor cleanups, extra error-checking
While we're at it, read_repo_config has been added and
expanded to handle case where command-line arguments are
optional to Getopt::Long

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:20 -07:00
Eric Wong
883d0a78d2 git-svn: Move all git-svn-related paths into $GIT_DIR/svn
Since GIT_SVN_ID usage is probably going to become more
widespread <evil grin>, we won't run the chance of somebody
having a GIT_SVN_ID name that conflicts with one of the default
directories that already exist in $GIT_DIR (branches/tags).

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:20 -07:00
Eric Wong
6dfbe5163e git-svn: support manually placed initial trees from fetch
Sometimes I don't feel like downloading an entire tree again when
I actually decide a branch is worth tracking, so some users can
get around it more easily with this.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:20 -07:00
Eric Wong
098749d9be git-svn: optimize --branch and --branch-all-ref
By breaking the pipe read once we've seen a commit twice.

This should make -B/--branch-all-ref faster and usable on a
frequent basis.

We use topological order now for calling git-rev-list, and any
commit we've seen before should imply that all parents have been
seen (at least I hope that's the case for --topo-order).

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:20 -07:00
Eric Wong
bf78b1d89b git-svn: --branch-all-refs / -B support
This should make life easier for all those who type:

	`git-rev-parse --symbolic --all | xargs -n1 echo -b`

every time they run git-svn fetch.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:20 -07:00
Eric Wong
162f412921 git-svn: support -C<num> passing to git-diff-tree
The repo-config key is 'svn.copysimilarity'

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:19 -07:00
Eric Wong
b63af9b340 git-svn: don't allow commit if svn tree is not current
If new revisions are fetched, that implies we haven't merged,
acked, or nacked them yet, and attempting to write the tree
we're committing means we'd silently clobber the newly fetched
changes.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:19 -07:00
Eric Wong
ce475dfcb5 git-svn: restore original LC_ALL setting (or unset) for commit
svn forces UTF-8 for commit messages, and with LC_ALL set to 'C'
it is unable to determine encoding of the git commit message.

Now we'll just assume the user has set LC_* correctly for
the commit message they're using.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:19 -07:00
Eric Wong
4a393f2b53 git-svn: eol_cp corner-case fixes
If we read the maximum size of our buffer into $buf, and the
last character is '\015', there's a chance that the character is
'\012', which means our regex won't work correctly.  At the
worst case, this could introduce an extra newline into the code.
We'll now read an extra character if we see '\015' is the last
character in $buf.

We also forgot to recalculate the length of $buf after doing the
newline substitution, causing some files to appeare truncated.
We'll do that now and force byte semantics in length() for good
measure.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:19 -07:00
Eric Wong
8a97e36888 git-svn: fix handling of filenames with embedded '@'
svn has trouble parsing files with embedded '@' characters.  For
example,

  svn propget svn:keywords foo@bar.c
  svn: Syntax error parsing revision 'bar.c'

I asked about this on #svn and the workaround suggested was to append
an explicit revision specifier:

  svn propget svn:keywords foo@bar.c@BASE

This patch appends '@BASE' to the filename in all calls to 'svn
propget'.

Patch originally by Seth Falcon <sethfalcon@gmail.com>
Seth: signoff?

[ew: Made to work with older svn that don't support peg revisions]

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:19 -07:00
Eric Wong
c7162c1db6 git-svn: t0000: add -f flag to checkout
Some changes to the latest git.git made this test croak.  So
we'll always just force everything when using a new branch.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
2006-06-16 03:04:19 -07:00
Aneesh Kumar K.V
4e2e5647f2 gitview: Add some useful keybindings.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-04 13:29:36 -07:00
Eric Wong
037b048ece git-svn: remove assertion that broke with older versions of svn
svn < 1.3.x would display changes to keywords lines as modified
if they aren't expanded in the working copy.  We already check
for changes against the git tree here, so checking against the
svn one is probably excessive.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-29 23:14:50 -07:00
Eric Wong
3c4c7351c0 git-svn: t0001: workaround a heredoc bug in old versions of dash
The dash installed on my Debian Sarge boxes don't seem to like
<<'' as a heredoc starter.  Recent versions of dash do not need
this fix.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-29 23:14:49 -07:00
Aneesh Kumar K.V
756944350d gitview: Move the console error messages to message dialog
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-28 10:53:08 -07:00
Aneesh Kumar K.V
034016391c gitview: Add key binding for F5.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-28 10:52:38 -07:00
Eric Wong
36f5b1f0c8 git-svn: ignore expansion of svn:keywords
Unlike my earlier test patch, this also checks svn:eol-style and
makes sure it's applied to working copy updates.  This is
definitely more correct than my original attempt at killing
keyword expansions, but I still haven't tested it enough to
know.  Feedback would be much appreciated.

Also changed assert_svn_wc_clean() to only work on the svn
working copy.  This requires a separate call to assert_tree() to
check wc integrity against git in preparation for another change
I'm planning.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 21:37:30 -07:00
Eric Wong
304dac1548 git-svn: starting a 1.1.0-pre development version
Some not-very-well-tested changes coming...

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 21:37:23 -07:00
Junio C Hamano
288c038450 Merge branch 'js/fetchconfig'
* js/fetchconfig:
  Add a conversion tool to migrate remote information into the config
  fetch, pull: ask config for remote information
2006-05-19 17:44:07 -07:00
Eric Wong
88521450fc git-svn 1.0.0
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-05 14:19:11 -07:00
Eric Wong
81c5a0e6e5 git-svn: documentation updates
* Clarify that 'init' requires an argument
* Remove instances of 'SVN_URL' in the manpage, it's not an
  environment variable.
* Refer to 'Additional Fetch Arguments' when documenting 'fetch'
* document --authors-file / -A option

Thanks to Pavel Roskin and Seth Falcon for bringing these issues
to my attention.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-05 14:18:41 -07:00
Johannes Schindelin
a4a6e4ab32 Add a conversion tool to migrate remote information into the config
Use this tool to rewrite the .git/remotes/* files into the config.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-04 00:07:06 -07:00
Junio C Hamano
96afa0764e Add colordiff for git to contrib/colordiff.
I hacked it up to teach it the git extended diff headers, made
it not to read the whole patch in the array.

Also, the original program, when arguments are given, ran "diff"
with the given arguments and showed the output from it.  Of
course, I changed it to run "git diff" ;-).

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-21 22:24:30 -07:00
Eric Wong
fc9957b005 contrib/git-svn: handle array values correctly
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-04 00:09:47 -07:00
Eric Wong
5f2f424002 contrib/git-svn: make sure our git-svn is up-to-date for test
Bugs like the last one could've been avoided if it weren't for
this...

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-04 00:09:45 -07:00
Eric Wong
5941a9e9d8 contrib/git-svn: ensure repo-config returns a value before using it
fetching from repos without an authors-file defined was broken.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-04 00:09:42 -07:00
Eric Wong
20b1d700c9 contrib/git-svn: documentation updates
contrib/git-svn/git-svn.txt:
	added git-repo-config key names for options
	fixed quoting of "git-svn-HEAD" in the manpage
	use preformatted text for examples

contrib/git-svn/Makefile:
	add target to generate HTML:
		http://git-svn.yhbt.net/git-svn.html

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-01 21:57:55 -08:00
Eric Wong
53909056da contrib/git-svn: accept configuration via repo-config
repo-config keys are any of the long option names minus the '-'
characters

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-01 21:57:52 -08:00
Eric Wong
13ccd6d4f2 contrib/git-svn: force GIT_DIR to an absolute path
We chdir internally, so we need a consistent GIT_DIR variable.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-30 15:40:38 -08:00
Eric Wong
0382318424 contrib/git-svn: stabilize memory usage for big fetches
We should be safely able to import histories with thousands
of revisions without hogging up lots of memory.

With this, we lose the ability to autocorrect mistakes when
people specify revisions in reverse, but it's probably no longer
a problem since we only have one method of log parsing nowadays.

I've added an extra check to ensure that revision numbers do
increment.

Also, increment the version number to 0.11.0.  I really should
just call it 1.0 soon...

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-25 21:23:54 -08:00
Eric Wong
ac74905064 contrib/git-svn: allow rebuild to work on non-linear remote heads
Because committing back to an SVN repository from different
machines can result in different lineages, two different
repositories running git-svn can result in different commit
SHA1s (but of the same tree).  Sometimes trees that are tracked
independently are merged together (usually via children),
resulting in non-unique git-svn-id: lines in rev-list.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-20 23:31:19 -08:00
Alexandre Julliard
2b1c0ef2e5 git.el: Added a function to diff against the other heads in a merge.
git-diff-file-merge-head generates a diff against the first merge
head, or with a prefix argument against the nth head. Bound to `d h'
by default.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-19 12:30:14 -08:00
Alexandre Julliard
75a8180d4b git.el: Get the default user name and email from the repository config.
If user name or email are not set explicitly, get them from the
user.name and user.email configuration values before falling back to
the Emacs defaults.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-19 12:30:07 -08:00
Alexandre Julliard
9de83169d3 git.el: More robust handling of subprocess errors when returning strings.
Make sure that functions that call a git process and return a string
always return nil when the subprocess failed.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-19 12:30:01 -08:00
Eric Wong
779b144625 contrib/git-svn: fix a harmless warning on rebuild (with old repos)
It's only for repositories that were imported with very early
versions of git-svn.  Unfortunately, some of those repos are out
in the wild already, so fix this warning.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-09 10:10:30 -08:00
Eric Wong
7317ed906a contrib/git-svn: remove the --no-stop-on-copy flag
Output a big warning if somebody actually has a pre-1.0 version
of svn that doesn't support it.

Thanks to Yann Dirson for reminding me it still existed
and attempting to re-enable it :)

I think I subconciously removed support for it earlier...

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-09 10:10:18 -08:00
Eric Wong
1d52aba839 contrib/git-svn: fix svn compat and fetch args
'svn info' doesn't work with URLs in svn <= 1.1.  Now we
only run svn info in local directories.

As a side effect, this should also work better for 'init' off
directories that are no longer in the latest revision of the
repository.

svn checkout -r<revision> arguments are fixed.
Newer versions of svn (1.2.x) seem to need URL@REV as well as
-rREV to checkout a particular revision...

Add an example in the manpage of how to track directory that has
been moved since its initial revision.

A huge thanks to Yann Dirson for the bug reporting and testing
my original patch.  Thanks also to Junio C Hamano for suggesting
a safer way to use git-rev-parse.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-09 10:04:58 -08:00
Mark Wooding
8911db70f8 contrib/emacs/Makefile: Provide tool for byte-compiling files.
Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-05 11:32:49 -08:00
Alexandre Julliard
a79656e6af git.el: Added customize support for all parameters.
Also fixed quoting of git-log-msg-separator.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-04 13:47:02 -08:00
Alexandre Julliard
45033ad9e3 git.el: Added support for Signed-off-by.
If `git-append-signed-off-by' is non-nil, automatically append a
sign-off line to the log message when editing it.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-04 13:46:52 -08:00
Alexandre Julliard
b23761d9ac git.el: Automatically update .gitignore status.
Update .gitignore files in the status list as they are created or
modified.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-04 13:46:20 -08:00
Alexandre Julliard
a944652c05 git.el: Set default directory before running the status mode setup hooks.
Also set the list-buffers-directory variable for nicer buffer list
display.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-04 13:46:13 -08:00
Alexandre Julliard
18e3e99e3d git.el: Portability fixes for XEmacs and Emacs CVS.
Fixed octal constants for XEmacs.
Added highlighting support in log-edit buffer for Emacs CVS.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-04 13:45:58 -08:00
Alexandre Julliard
486a974acc contrib/emacs: Add an Emacs VC backend.
Add a basic Emacs VC backend. It currently supports the following
commands: checkin, checkout, diff, log, revert, and annotate. There is
only limited support for working with revisions other than HEAD.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-04 13:45:37 -08:00
Eric Wong
ce4c8b24a1 contrib/git-svn: fix a copied-tree bug in an overzealous assertion
I thought passing --stop-on-copy to svn would save us from all
the trouble svn-arch-mirror had with directory (project) copies.
I was wrong, there was one thing I overlooked.

If a tree was moved from /foo/trunk to /bar/foo/trunk with no
other changes in r10, but the last change was done in r5, the
Last Changed Rev (from svn info) in /bar/foo/trunk will still be
r5, even though the copy in the repository didn't exist until
r10.

Now, if we ever detect that the Last Changed Rev isn't what
we're expecting, we'll run svn diff and only croak if there are
differences between them.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-03 15:07:12 -08:00
Eric Wong
448c81b495 contrib/git-svn: better documenting of CLI switches
Also, fix a asciidoc formatting error

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-03 11:27:30 -08:00
Eric Wong
6f0783cf94 contrib/git-svn: add --id/-i=$GIT_SVN_ID command-line switch
I ended up using GIT_SVN_ID far more than I ever thought I
would.  Typing less is good.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-03 11:27:29 -08:00
Eric Wong
1ca72aef45 contrib/git-svn: avoid re-reading the repository uuid, it never changes
If it does change, we're screwed anyways as SVN will refuse to
commit or update.  We also never access more than one SVN
repository per-invocation, so we can store it as a global, too.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-03 11:27:27 -08:00
Eric Wong
7f60b22860 contrib/git-svn: create a more recent master if one does not exist
In a new repository, the initial fetch creates a master branch
if one does not exist so HEAD has something to point to.

It now creates a master at the end of the initial fetch run,
pointing to the latest revision.  Previously it pointed to the
first revision imported, which is generally less useful.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-03 11:27:25 -08:00
Eric Wong
eeb0abe047 contrib/git-svn: cleanup option parsing
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-03 11:27:22 -08:00
Eric Wong
a9612be245 contrib/git-svn: allow --authors-file to be specified
Syntax is compatible with git-svnimport and git-cvsimport:

	normalperson = Eric Wong <normalperson@yhbt.net>

If this option is specified and git-svn encounters an SVN
committer name that it cannot parse, it git-svn will abort.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-03 11:27:20 -08:00
Eric Wong
df746c5a81 contrib/git-svn: strip 'git-svn-id:' when commiting to SVN
We regenerate and use git-svn-id: whenever we fetch or otherwise
commit to remotes/git-svn.  We don't actually know what revision
number we'll commit to SVN at commit time, so this is useless.
It won't throw off things like 'rebuild', though, which knows to
only use the last instance of git-svn-id: in a log message

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-03 11:27:18 -08:00
Eric Wong
ac8e0b910c contrib/git-svn: several small bug fixes and changes
* Fixed manually-edited commit messages not going to
   remotes/git-svn on sequential commits after the sequential
   commit optimization.
 * format help correctly after adding 'show-ignore'
 * sha1_short regexp matches down to 4 hex characters
   (from git-rev-parse --short documentation)
 * Print the first line of the commit message when we commit to
   SVN next to the sha1.
 * Document 'T' (type change) in the comments

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-03 11:27:14 -08:00
Eric Wong
69f0d91e49 contrib/git-svn: add -b/--branch switch for branch detection
I've said I don't like branches in Subversion, and I still don't.
This is a bit more flexible, though, as the argument for -b is any
arbitrary git head/tag reference.

This makes some things easier:
 * Importing git history into a brand new SVN branch.
 * Tracking multiple SVN branches via GIT_SVN_ID, even from multiple
   repositories.
 * Adding tags from SVN (still need to use GIT_SVN_ID, though).
 * Even merge tracking is supported, if and only the heads end up with
   100% equivalent tree objects.  This is more stricter but more robust
   and foolproof than parsing commit messages, imho.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-03 11:27:10 -08:00
Aneesh Kumar K.V
9645da330f gitview: pass the missing argument _show_clicked_cb.
In our last update to use the encoding while showing the commit
diff we added a new argument to this function. But we missed
updating all the callers.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-02 23:07:01 -08:00
Eric Wong
2beb3cdd18 contrib/git-svn: use refs/remotes/git-svn instead of git-svn-HEAD
After reading a lengthy discussion on the list, I've come to the
conclusion that creating a 'remotes' directory in refs isn't
such a bad idea.

You can still branch from it by specifying remotes/git-svn (not
needing the leading 'refs/'), and the documentation has been
updated to reflect that.

The 'git-svn' part of the ref can of course be set to whatever
you want by using the GIT_SVN_ID environment variable, as
before.

I'm using refs/remotes/git-svn, and not going with something
like refs/remotes/git-svn/HEAD as it's redundant for Subversion
where there's zero distinction between branches and directories.

Run git-svn rebuild --upgrade to upgrade your repository to use
the new head.  git-svn-HEAD must be manually deleted for safety
reasons.

Side note: if you ever (and I hope you never) want to run
git-update-refs on a 'remotes/' ref, make sure you have the
'refs/' prefix as you don't want to be clobbering your
'remotes/' in $GIT_DIR (where remote URLs are stored).

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-02 00:01:36 -08:00
Aneesh Kumar K.V
5aa44d50f4 gitview: Use horizontal scroll bar in the tree view
Earlier we set up the window to never scroll
horizontally, which made it harder to use on a narrow screen.
This patch allows scrollbar to be used as needed by Gtk

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-03-01 21:32:00 -08:00
Aneesh Kumar K.V
d82343b938 gitview: Set the default width of graph cell
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-28 11:02:10 -08:00
Aneesh Kumar K.V
0852694ba4 gitview: Some window layout changes.
This makes menubar look nice

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-28 11:02:08 -08:00
Pavel Roskin
3abe217a5b gitview: Select the text color based on whether the entry in highlighted. Use standard font.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-28 11:02:02 -08:00
Eric Wong
7be737680f contrib/git-svn: correct commit example in manpage
Thanks to Nicolas Vilz <niv@iaglans.de> for noticing this.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-27 15:27:51 -08:00
Eric Wong
b705ba43c6 contrib/git-svn: tell the user to not modify git-svn-HEAD directly
As a rule, interface branches to different SCMs should never be modified
directly by the user.  They are used exclusively for talking to the
foreign SCM.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-27 12:55:16 -08:00
Aneesh Kumar K.V
c447f10f99 gitview: Remove trailing white space
Do the cleanup using Dave jones vim script

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-27 11:01:58 -08:00
Aneesh Kumar K.V
68d55b83a5 gitview: Fix the encoding related bug
Get the encoding information from repository and convert it to utf-8 before
passing to gtk.TextBuffer.set_text. gtk.TextBuffer.set_text work only with utf-8

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-27 11:01:54 -08:00
Eric Wong
3c0b7511cd contrib/git-svn: version 0.10.0
New features deserve an increment of the minor version.  This will very
likely become 1.0.0 unless release-critical bugs are found.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-26 15:04:59 -08:00
Eric Wong
e17512f3de contrib/git-svn: optimize sequential commits to svn
Avoid running 'svn up' to a previous revision if we know the
revision we just committed is the first descendant of the
revision we came from.

This reduces the time to do a series of commits by about 25%.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-26 15:02:45 -08:00
Eric Wong
8f22562c6b contrib/git-svn: add show-ignore command
Recursively finds and lists the svn:ignore property on
directories.  The output is suitable for appending to the
$GIT_DIR/info/exclude file.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-26 14:55:13 -08:00
Aneesh Kumar K.V
1509bd9e69 gitview: Fix the graph display .
This fix all the known issue with the graph display
The bug need to be explained graphically

                                 |
                                 a
This line need not be there ---->| \
                                 b  |
                                 | /
                                 c

c is parent of a and all a,b and c are placed on the same line and b is child of c
With my last checkin I added  a seperate line to indicate that a is
connected to c. But then we had the line connecting a and b which should
not be ther. This changes fixes the same bug

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-24 17:27:46 -08:00
Aneesh Kumar K.V
9e4f522da7 gitview: Code cleanup
Rearrange the code little bit so that it is easier to read

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-24 17:27:39 -08:00
Aneesh Kumar
20d23f554d gitview: Bump the rev
Make the 0.7 release

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-24 03:14:44 -08:00