aboutsummaryrefslogtreecommitdiff
path: root/contrib/fast-import
Commit message (Collapse)AuthorAge
* git-p4: Handle Windows EOLs properly after removal of p4 submit template ↵Marius Storm-Olsen2008-03-28
| | | | | | | | | | | handling. git-p4s handling of Windows style EOL was broken after the removal of the p4 submit template handling in commit f2a6059. Fix that, and make getP4OpenedType() more robust. Signed-off-by: Marius Storm-Olsen <marius@trolltech.com> Signed-off-by: Simon Hausmann <simon@lst.de>
* git-p4: Use P4EDITOR environment variable when setShawn Bohrer2008-03-13
| | | | | | | | | Perforce allows you to set the P4EDITOR environment variable to your preferred editor for use in perforce. Since we are displaying a perforce changelog to the user we should use it when it is defined. Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com> Signed-off-by: Simon Hausmann <simon@lst.de>
* git-p4: Unset P4DIFF environment variable when using 'p4 -du diff'Shawn Bohrer2008-03-13
| | | | | | | | | | | | | | A custom diffing utility can be specified for the 'p4 diff' command by setting the P4DIFF environment variable. However when using a custom diffing utility such as 'vimdiff' passing options like -du can cause unexpected behavior. Since the goal is to generate a unified diff of the changes and attach them to the bottom of the p4 submit log we should unset P4DIFF if it has been set in order to generate the diff properly. Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com> Signed-off-by: Simon Hausmann <simon@lst.de>
* git-p4: Optimize the fetching of data from perforce.Marius Storm-Olsen2008-03-13
| | | | | | | Use shallow copies in loop, and join content at the end. Then do the substitution, if needed. Signed-off-by: Marius Storm-Olsen <marius@trolltech.com> Signed-off-by: Simon Hausmann <simon@lst.de>
* git-p4: Fix import of changesets with file deletionsSimon Hausmann2008-03-03
| | | | | | | | | | | | | Commit 3a70cdfa42199e16d2d047c286431c4274d65b1a made readP4Files abort quickly when the changeset only contains files that are marked for deletion with an empty return value, which caused the commit to not do anything. This commit changes readP4Files to distinguish between files that need to be passed to p4 print and files that have no content ("deleted") and merge them in the returned list. Signed-off-by: Simon Hausmann <simon@lst.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-p4: Support usage of perforce client specTor Arvid Lund2008-02-27
| | | | | | | | | | When syncing, git-p4 will only download files that are included in the active perforce client spec. This does not change the default behaviour - it requires that the user either supplies the command line argument --use-client-spec, or sets the git config option p4.useclientspec to "true". Signed-off-by: Tor Arvid Lund <torarvid@gmail.com> Signed-off-by: Simon Hausmann <simon@lst.de>
* git-p4: git-p4 submit cleanups.Simon Hausmann2008-02-27
| | | | | | | Removed storing the list of commits in a configuration file. We only need the list of commits at run-time. Signed-off-by: Simon Hausmann <simon@lst.de>
* git-p4: Removed git-p4 submit --direct.Simon Hausmann2008-02-27
| | | | | | | | This feature was originally meant to allow for quicker direct submits into perforce, but it turns out that it is not actually quicker than doing a git commit and then running git-p4 submit. Signed-off-by: Simon Hausmann <simon@lst.de>
* git-p4: Clean up git-p4 submit's log message handling.Simon Hausmann2008-02-27
| | | | | | | Instead of trying to substitute fields in the p4 submit template we now simply replace the description of the submit with the log message of the git commit. Signed-off-by: Simon Hausmann <simon@lst.de>
* git-p4: Remove --log-substitutions feature.Simon Hausmann2008-02-27
| | | | | | This turns out to be rarely useful and is already covered by git's commit.template configuration variable. Signed-off-by: Simon Hausmann <simon@lst.de>
* git-p4: support exclude pathsTommy Thorn2008-02-27
| | | | | | | | | | | | | | | Teach git-p4 about the -/ option which adds depot paths to the exclude list, used when cloning. The option is chosen such that the natural Perforce syntax works, eg: git p4 clone //branch/path/... -//branch/path/{large,old}/... Trailing ... on exclude paths are optional. This is a generalization of a change by Dmitry Kakurin (thanks). Signed-off-by: Tommy Thorn <tommy-git@thorn.ws> Signed-off-by: Simon Hausmann <simon@lst.de>
* git-p4: Fix indentation from tab to spacesToby Allsopp2008-02-07
| | | | Signed-off-by: Toby Allsopp <toby.allsopp@navman.co.nz>
* git-p4: Fix an obvious typoTommy Thorn2008-02-03
| | | | | | | | | | The regexp "$," can't match anything. Clearly not intended. This was introduced in ce6f33c8 which is quite a while ago. Signed-off-by: Tommy Thorn <tommy-git@thorn.ws> Acked-by: Simon Hausmann <simon@lst.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-p4: Ensure the working directory and the index are clean before "git-p4 ↵Simon Hausmann2008-02-03
| | | | | | rebase" Signed-off-by: Simon Hausmann <simon@lst.de>
* git-p4: Fix submit user-interface.Simon Hausmann2008-02-03
| | | | | | Don't ask any questions when submitting, behave similar to git-svn dcommit. Signed-off-by: Simon Hausmann <simon@lst.de>
* Remove $Id: ..$ $Header: ..$ etc from +ko and +k files during importJason McMullan2008-02-03
| | | | | | | | | | This patch removes the '$Keyword: ...$' '...' data, so that files don't have spurious megre conflicts between branches. Handles both +ko and +k styles, and leaves the '$Foo$' in the original file. Signed-off-by: Simon Hausmann <simon@lst.de>
* git-p4: Fix typo in --detect-labelsShun Kei Leung2007-11-20
| | | | | Signed-off-by: Kevin Leung <kevinlsk@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-p4: Fix direct import from perforce after fetching changes through git ↵Simon Hausmann2007-11-16
| | | | | | | | | | | | | | | from origin When using an existing git repository to cache the perforce import we don't fetch the branch mapping from perforce as that is a slow operation. However the origin repository may not be fully up-to-date and therefore it may be necessary to import more changes directly from Perforce. Such a direct import needs self.knownBranches to be set up though, so initialize it from the existing p4/* git branches. Signed-off-by: Simon Hausmann <simon@lst.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-p4: Detect changes to executable bit and include them in p4 submit.Chris Pettitt2007-11-02
| | | | | | | | | | | | | | | | | This changeset takes advantage of the new parseDiffTreeEntry(...) function to detect changes to the execute bit in the git repository. During submit, git-p4 now looks for changes to the executable bit and if it finds them it "reopens" the file in perforce, which allows it to change the file type. The logic for adding the executable bit in perforce is straightforward: the +x modifier can be used. Removing the executable bit in perforce requires that the entire filetype be redefined (there is no way to join remove the bit with a -x modifier, for example). This changeset includes logic to remove the executable bit from the full file type while preserving the base file type and other modifiers. Signed-off-by: Chris Pettitt <cpettitt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-p4: Add a helper function to parse the full git diff-tree output.Chris Pettitt2007-11-02
| | | | | Signed-off-by: Chris Pettitt <cpettitt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-p4 support for perforce renames.Chris Pettitt2007-10-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | The current git-p4 implementation does support file renames. However, because it does not use the "p4 integrate" command, the history for the renamed file is not linked to the new file. This changeset adds support for perforce renames with the integrate command. Currently this feature is only enabled when calling git-p4 submit with the -M option. This is intended to look and behave similar to the "detect renames" feature of other git commands. The following sequence is used for renamed files: p4 integrate -Dt x x' p4 edit x' rm x' git apply p4 delete x By default, perforce will not allow an integration with a target file that has been deleted. That is, if x' in the example above is the name of a previously deleted file then perforce will fail the integrate. The -Dt option tells perforce to allow the target of integrate to be a previously deleted file. Signed-off-by: Chris Pettitt <cpettitt@gmail.com> Signed-off-by: Simon Hausmann <simon@lst.de>
* git-p4: When skipping a patch as part of "git-p4 submit" make sure we ↵Simon Hausmann2007-10-20
| | | | | | correctly revert to the previous state of the files using "p4 revert". Signed-off-by: Simon Hausmann <simon@lst.de>
* Add 'git-p4 commit' as an alias for 'git-p4 submit'Marius Storm-Olsen2007-10-15
| | | | | | | | | | Given that git uses 'commit', git-p4's 'sumbit' was a bit confusing at times; often making me do 'git submit' and 'git-p4 commit' instead. Signed-off-by: Marius Storm-Olsen <marius@trolltech.com> Acked-By: Simon Hausmann <simon@lst.de> Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Merge branch 'maint'Junio C Hamano2007-09-23
|\ | | | | | | | | | | | | | | | | | | | | | | * maint: git-svn: don't attempt to spawn pager if we don't want one Supplant the "while case ... break ;; esac" idiom User Manual: add a chapter for submodules user-manual: don't assume refs are stored under .git/refs Detect exec bit in more cases. Conjugate "search" correctly in the git-prune-packed man page. Move the paragraph specifying where the .idx and .pack files should be Documentation/git-lost-found.txt: drop unnecessarily duplicated name.
| * Detect exec bit in more cases.David Brown2007-09-22
| | | | | | | | | | | | | | git-p4 was missing the execute bit setting if the file had other attribute bits set. Acked-By: Simon Hausmann <simon@lst.de>
* | contrib/fast-import: add perl version of simple exampleJeff King2007-09-18
| | | | | | | | | | | | | | | | | | | | This is based on the git-import.sh script, but is a little more robust and efficient. More importantly, it should serve as a quick template for interfacing fast-import with perl scripts. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | contrib/fast-import: add simple shell exampleNguyen Thai Ngoc Duy2007-09-18
| | | | | | | | | | | | | | | | | | | | | | | | This example just puts a directory under git control. It is significantly slower than using the git tools directly, but hopefully shows a bit how fast-import works. [jk: added header comments] Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-p4: Added support for automatically importing newly appearing perforce ↵Simon Hausmann2007-09-03
| | | | | | | | | | | | | | | | | | | | | | | | | | branches. If a change in a p4 "branch" appears that hasn't seen any previous commit and that has a known branch mapping we now try to import it properly. First we find the p4 change of the source branch that the new p4 branch is based on. Then we using git rev-list --bisect to locate the corresponding git commit to that change. Finally we import all changes in the new p4 branch up to the current change and resume with the regular import. Signed-off-by: Simon Hausmann <simon@lst.de>
* | git-p4: Cleanup; moved the (duplicated) code for turning a branch into a git ↵Simon Hausmann2007-09-03
| | | | | | | | | | | | ref (for example foo -> refs/remotes/p4/<project>/foo) into a separate method. Signed-off-by: Simon Hausmann <simon@lst.de>
* | git-p4: Cleanup; moved the code for the initial #head or revision import ↵Simon Hausmann2007-09-03
| | | | | | | | | | | | into a separate function, out of P4Sync.run. Signed-off-by: Simon Hausmann <simon@lst.de>
* | git-p4: Cleanup; Turn self.revision into a function local variable (it's not ↵Simon Hausmann2007-09-03
| | | | | | | | | | | | used anywhere outside the function). Signed-off-by: Simon Hausmann <simon@lst.de>
* | git-p4: Cleanup; moved the code to import a list of p4 changes using ↵Simon Hausmann2007-09-03
| | | | | | | | | | | | fast-import into a separate member function of P4Sync. Signed-off-by: Simon Hausmann <simon@lst.de>
* | git-p4: Cleanup; moved the code for getting a sorted list of p4 changes for ↵Simon Hausmann2007-09-03
| | | | | | | | | | | | a list of given depot paths into a standalone method. Signed-off-by: Simon Hausmann <simon@lst.de>
* | git-p4: After submission to p4 always synchronize from p4 again (into ↵Simon Hausmann2007-09-03
| | | | | | | | | | | | refs/remotes). Whether to rebase HEAD or not is still left as question to the end-user. Signed-off-by: Simon Hausmann <simon@lst.de>
* | git-p4: Always call 'p4 sync ...' before submitting to Perforce.Simon Hausmann2007-09-03
|/ | | | | Acked-by: Marius Storm-Olsen <marius@trolltech.com> Acked-by: Thiago Macieira <thiago@kde.org>
* git-p4: Fix warnings about non-existant refs/remotes/p4/HEAD ref when ↵Simon Hausmann2007-08-24
| | | | | | | | | running git-p4 sync the first time after a git clone. Don't create the p4/HEAD symbolic ref if p4/master doesn't exist yet. Signed-off-by: Simon Hausmann <simon@lst.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-p4: Make 'git-p4 branches' work after an initial clone with git clone ↵Simon Hausmann2007-08-24
| | | | | | | | | | | from an origin-updated repository. After a clone with "git clone" of a repository the p4 branches are only in remotes/origin/p4/* and not in remotes/p4/*. Separate the code for detection and creation out of the P4Sync command class into standalone methods and use them from the P4Branches command. Signed-off-by: Simon Hausmann <simon@lst.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-p4: Fix the sorting of changelists when cloning a Perforce repository.Reece H. Dunn2007-08-13
| | | | | | | | | | | 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>
* git-p4: Fix git-p4 submit to include only changed files in the perforce ↵Simon Hausmann2007-08-08
| | | | | | | | | | 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>
* git-p4: Fix support for symlinks.Simon Hausmann2007-08-08
| | | | | | | | | 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>
* Fix style nit in Python slicing.Han-Wen Nienhuys2007-08-02
| | | | | | | Python slices start at 0 by default. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Simon Hausmann <simon@lst.de>
* Sort output of "p4 change" in incremental import before furtherHan-Wen Nienhuys2007-08-02
| | | | | | | | | | 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>
* git-p4: Fix p4 user cache population on Windows.Simon Hausmann2007-07-25
| | | | | | | | 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>
* git-p4: Cleanup, used common function for listing imported p4 branchesSimon Hausmann2007-07-18
| | | | Signed-off-by: Simon Hausmann <simon@lst.de>
* git-p4: Fix upstream branch detection for submit/rebase with multiple branches.Simon Hausmann2007-07-18
| | | | | | | | 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>
* git-p4: Cleanup, make listExistingP4Branches a global function for later use.Simon Hausmann2007-07-18
| | | | | Signed-off-by: Simon Hausmann <simon@lst.de> Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
* git-p4: input to "p4 files" by stdin instead of argumentsScott Lamb2007-07-17
| | | | | | | | | 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>
* git-p4: use subprocess in p4CmdListScott Lamb2007-07-17
| | | | | | | | 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>
* Fix git-p4 on Windows to not use the Posix sysconf function.Marius Storm-Olsen2007-07-14
| | | | | | | | | | 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>
* Import branch 'git-p4' of git://repo.or.cz/fast-exportShawn O. Pearce2007-06-22
|\ | | | | | | | | | | | | | | | | 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.