Commit graph

554 commits

Author SHA1 Message Date
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