aboutsummaryrefslogtreecommitdiff
path: root/contrib/fast-import
Commit message (Collapse)AuthorAge
* git-p4: Allow branch definition with git configVitor Antunes2011-08-22
| | | | | | | | | | | Perforce does not strictly require the usage of branch specifications to create branches. In these cases the branch detection code of git-p4 will not be able to import them. This patch adds support for git-p4.branchList configuration option, allowing branches to be defined in git config. Signed-off-by: Vitor Antunes <vitor.hda@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-p4: Allow filtering Perforce branches by userVitor Antunes2011-08-22
| | | | | | | | | | | | | | | All branches in the Perforce server are downloaded to allow branch detection. If you have a centralized server on a remote location and there is a big number of branches this operation can take some time. This patch adds the configuration option git-p4.branchUser to allow filtering the branch list by user. Although this limits the branch maintenance in Perforce to be done by a single user, it might be an advantage when the number of branches being used in a specific depot is very small when compared with the branches available in the server. Signed-off-by: Vitor Antunes <vitor.hda@gmail.com> Acked-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-p4: Correct branch base depot path detectionVitor Antunes2011-08-22
| | | | | | | | | | | | | | | | | | | | | When branch detection is enabled each branch is named in git after their relative depot path in Perforce. To do this the depot paths are compared against each other to find their common base path. The current algorithm makes this comparison on a character by character basis. Assuming we have the following branches: //depot/branches/featureA //depot/branches/featureB Then the base depot path would be //depot/branches/feature, which is an invalid depot path. The current patch fixes this by splitting the path into a list and comparing the list entries, making it choose correctly //depot/branches as the base path. Signed-off-by: Vitor Antunes <vitor.hda@gmail.com> Acked-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-p4: Process detectCopiesHarder with --boolVitor Antunes2011-08-22
| | | | | | Signed-off-by: Vitor Antunes <vitor.hda@gmail.com> Acked-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-p4: Add description of rename/copy detection optionsVitor Antunes2011-08-22
| | | | | | Signed-off-by: Vitor Antunes <vitor.hda@gmail.com> Acked-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-p4: Allow setting rename/copy detection thresholdVitor Antunes2011-08-22
| | | | | | | | | | | | Copy and rename detection arguments (-C and -M) allow setting a threshold value for the similarity ratio. If the similarity is below this threshold the rename or copy is ignored and the file is added as new. This patch allows setting git-p4.detectRenames and git-p4.detectCopies options to an integer value to set the respective threshold. Signed-off-by: Vitor Antunes <vitor.hda@gmail.com> Acked-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-p4: commit time should be most recent p4 change timePete Wyckoff2011-08-01
| | | | | | | | | | | | When importing a repo, the time on the initial commit had been just "now". But this causes problems when trying to share among git-p4 repos that were created identically, although at different times. Instead, use the time in the top-most p4 change as the time for the git import commit. Signed-off-by: Pete Wyckoff <pw@padd.com> Acked-by: Luke Diamand <luke@diamand.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-p4: warn if git authorship won't be retainedLuke Diamand2011-05-13
| | | | | | | | | | | | | If the git commits you are submitting contain changes made by other people, the authorship will not be retained. Change git-p4 to warn of this and to note that --preserve-user can be used to solve the problem (if you have suitable permissions). The warning can be disabled. Add a test case and update documentation. Signed-off-by: Luke Diamand <luke@diamand.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-p4: small improvements to user-preservationLuke Diamand2011-05-09
| | | | | | | | | | | | . Slightly more paranoid checking of results from 'p4 change' . Remove superfluous "-G" . Don't modify the username if it is unchanged. . Add a comment in the change template to show what is going to be done. Signed-off-by: Luke Diamand <luke@diamand.org> Acked-By: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-p4: add option to preserve user namesLuke Diamand2011-04-26
| | | | | | | | | | | | | | | | Patches from git passed into p4 end up with the committer being identified as the person who ran git-p4. With "submit --preserve-user", git-p4 modifies the p4 changelist (after it has been submitted), setting the p4 author field. The submitter is required to have sufficient p4 permissions or git-p4 refuses to proceed. If the git author is not known to p4, the submit will be abandoned unless git-p4.allowMissingP4Users is true. Signed-off-by: Luke Diamand <luke@diamand.org> Acked-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-p4: replace each tab with 8 spaces for consistencyAndrew Garber2011-04-07
| | | | | | | | | Note that the majority of git-p4 uses spaces, not tabs, for indentation. Consistent indentation is a good hygiene for Python scripts, and mixing tabs and spaces in Python can lead to hard-to-find bugs. Signed-off-by: Andrew Garber <andrew@andrewgarber.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'pw/p4'Junio C Hamano2011-03-23
|\ | | | | | | | | | | * pw/p4: git-p4: test sync new branch git-p4: fix sync new branch regression
| * git-p4: fix sync new branch regressionPete Wyckoff2011-03-16
| | | | | | | | | | | | | | | | | | | | | | | | | | e32e00d (git-p4: better message for "git-p4 sync" when not cloned, 2011-02-19) broke another use case, that of using "git-p4 sync" to import a new branch into an existing repository. Refine the fix again, on top of the fix in ac34efc. Reported-by: Michael Horowitz <michael.horowitz@ieee.org> Signed-off-by: Pete Wyckoff <pw@padd.com> Tested-by: Michael Horowitz <michael.horowitz@ieee.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-p4: Fix error message crash in P4Sync.commit.Tor Arvid Lund2011-03-15
| | | | | | | | | | | | | | | | | | | | | | There is an error message that crashes the script because of an invalid ref to the non-existing "path" variable. It is almost never printed, which would explain why nobody encountered this problem before... But anyway, this oneliner fixes it. Signed-off-by: Tor Arvid Lund <torarvid@gmail.com> Acked-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Teach git-p4 to ignore case in perforce filenames if configured.Tor Arvid Lund2011-03-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When files are added to perforce, the path to that file has whichever case configuration that exists on the machine of the user who added the file. What does that mean? It means that when Alice adds a file //depot/DirA/FileA.txt ... and Bob adds: //depot/dirA/FileB.txt ... we may or may not get a problem. If a user sets the config variable git-p4.ignorecase to "true", we will consider //depot/DirA and //depot/dirA to be the same directory. Signed-off-by: Tor Arvid Lund <torarvid@gmail.com> Acked-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-p4: Teach gitConfig method about arguments.Tor Arvid Lund2011-03-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this patch, it is possible to call the gitConfig method with an optional argument string, which will be passed to the "git config" executable. For instance: gitConfig("core.ignorecase", "--bool") will ensure that you get the value "true", and won't have to check the returned value for [1, true, on, yes]. Signed-off-by: Tor Arvid Lund <torarvid@gmail.com> Acked-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'pw/p4'Junio C Hamano2011-03-13
|\ \ | |/ | | | | | | | | * pw/p4: git-p4: test clone @all git-p4: fix clone @all regression
| * git-p4: fix clone @all regressionPete Wyckoff2011-03-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | e32e00d (git-p4: better message for "git-p4 sync" when not cloned, 2011-02-19) broke the use of the "@all" revision specifier, e.g., git-p4 clone //depot/xxx@all Fix it as per Tor Arvid's quick patch. Signed-off-by: Pete Wyckoff <pw@padd.com> Reported-by: Anatol Pomozov <anatol.pomozov@gmail.com> Based-on-patch-by: Tor Arvid Lund <torarvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'mh/p4'Junio C Hamano2011-03-04
|\ \ | | | | | | | | | | | | * mh/p4: git-p4 submit: prevent 'Jobs' section from being removed from p4 change log
| * | git-p4 submit: prevent 'Jobs' section from being removed from p4 change logMichael Horowitz2011-02-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | In an attempt to overwrite the 'Description:' section of the p4 change log to include the git commit messages, it also overwrote the 'Jobs:' section.  This fix restores the 'Job:' section. Signed-off-by: Michael Horowitz <michael.horowitz@ieee.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'va/p4'Junio C Hamano2011-02-27
|\ \ \ | | | | | | | | | | | | | | | | | | | | * va/p4: git-p4: Add copy detection support git-p4: Improve rename detection support
| * | | git-p4: Add copy detection supportVitor Antunes2011-02-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new config options: git-p4.detectCopies - Enable copy detection. git-p4.detectCopiesHarder - Find copies harder. The detectCopies option should be set to a true/false value. The detectCopiesHarder option should be set to true/false value. P4Submit can now process diff-tree C status and integrate files accordingly. Signed-off-by: Vitor Antunes <vitor.hda@gmail.com> Acked-by: Pete Wyckoff <pw@padd.com> Acked-by: Tor Arvid Lund <torarvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | git-p4: Improve rename detection supportVitor Antunes2011-02-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only open files for edit after integrating if the SHA1 of source and destination differ from each other. Add git config option detectRenames to allow permanent rename detection. This options should be set to a true/false value. Rename "detectRename" variable to "detectRenames" to make it more coherent with the description in git man pages, which always use plural. Signed-off-by: Vitor Antunes <vitor.hda@gmail.com> Acked-by: Pete Wyckoff <pw@padd.com> Acked-by: Tor Arvid Lund <torarvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'pw/p4'Junio C Hamano2011-02-27
|\ \ \ \ | |_|/ / |/| | / | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | * pw/p4: git-p4: support clone --bare git-p4: decode p4 wildcard characters git-p4: better message for "git-p4 sync" when not cloned git-p4: reinterpret confusing p4 message git-p4: accommodate new move/delete type in p4 git-p4: add missing newline in initial import message git-p4: fix key error for p4 problem git-p4: test script
| * | git-p4: support clone --barePete Wyckoff2011-02-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | Just like git clone --bare, build a .git directory but no checked out files. Signed-off-by: Pete Wyckoff <pw@padd.com> Acked-By: Tor Arvid Lund <torarvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | git-p4: decode p4 wildcard charactersPete Wyckoff2011-02-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are four wildcard characters in p4. Files with these characters can be added to p4 repos using the "-f" option. They are stored in %xx notation, and when checked out, p4 converts them back to normal. This patch does the same thing when importing into git, converting the four special characters. Without this change, the files appear with literal %xx in their names. Be careful not to produce "*" in filenames on windows. That will fail. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | git-p4: better message for "git-p4 sync" when not clonedPete Wyckoff2011-02-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A common error is to do "git-p4 sync" in a repository that was not initialized by "git-p4 clone". There will be no p4 refs. The error message in this case is a traceback for an assertion, which is confusing. Change it instead to explain the likely problem. Signed-off-by: Pete Wyckoff <pw@padd.com> Acked-By: Tor Arvid Lund <torarvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | git-p4: reinterpret confusing p4 messagePete Wyckoff2011-02-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Error output will look like this: glom$ git p4 clone //deopt Importing from //deopt into . Reinitialized existing Git repository in /tmp/x/.git/ Doing initial import of //deopt from revision #head into refs/remotes/p4/master p4 returned an error: //deopt/... - must refer to client glom. This particular p4 error is misleading. Perhaps the depot path was misspelled. Depot path: //deopt Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | git-p4: accommodate new move/delete type in p4Pete Wyckoff2011-02-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 562d53f (git-p4: Fix sync errors due to new server version, 2010-01-21) taught git-p4 sync to recognize the new move/delete type, but this type can also show up in an initial clone and labels output. Instead of replicating the support in three places, hoist the definition somewhere global. Signed-off-by: Pete Wyckoff <pw@padd.com> Acked-By: Tor Arvid Lund <torarvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | git-p4: add missing newline in initial import messagePete Wyckoff2011-02-21
| | | | | | | | | | | | | | | | | | Signed-off-by: Pete Wyckoff <pw@padd.com> Acked-By: Tor Arvid Lund <torarvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | git-p4: fix key error for p4 problemPete Wyckoff2011-02-21
| |/ | | | | | | | | | | | | | | | | | | | | | | | | Some p4 failures result in an error, but the info['code'] is not set. These include a bad p4 executable, or a core dump from p4, and other odd internal errors where p4 fails to generate proper marshaled output. Make sure the info key exists before using it to avoid a python traceback. Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Obey p4 views when using client specIan Wienand2011-02-14
|/ | | | | | | | | | | | | | | | | | | | | | | | When using the p4 client spec, this attempts to obey the client's output preferences. For example, a view like //depot/foo/branch/... //client/branch/foo/... //depot/bar/branch/... //client/branch/bar/... will result in a directory layout in the git tree of branch/ branch/foo branch/bar p4 can do various other reordering that this change doesn't support, but we should detect it and at least fail nicely. Signed-off-by: Ian Wienand <ianw@vmware.com> Acked-by: Pete Wyckoff <pw@padd.com> Acked-by: Tor Arvid Lund <torarvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'aw/git-p4-deletion'Junio C Hamano2010-11-05
|\ | | | | | | | | * aw/git-p4-deletion: Fix handling of git-p4 on deleted files
| * Fix handling of git-p4 on deleted filesAndrew Waters2010-10-22
| | | | | | | | | | | | Signed-off-by: Andrew Waters <apwaters@googlemail.com> Tested-by: Thomas Berg <merlin66b@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | perl: use "use warnings" instead of -wÆvar Arnfjörð Bjarmason2010-09-27
|/ | | | | | | | | | | | | | | | | | | Change the Perl scripts to turn on lexical warnings instead of setting the global $^W variable via the -w switch. The -w sets warnings for all code that interpreter runs, while "use warnings" is lexically scoped. The former is probably not what the authors wanted. As an auxiliary benefit it's now possible to build Git with: PERL_PATH='/usr/bin/env perl' Which would previously result in failures, since "#!/usr/bin/env perl -w" doesn't work as a shebang. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'rb/maint-python-path'Junio C Hamano2010-04-03
|\ | | | | | | | | * rb/maint-python-path: Correct references to /usr/bin/python which does not exist on FreeBSD
| * Correct references to /usr/bin/python which does not exist on FreeBSDR. Tyler Ballance2010-03-24
| | | | | | | | | | | | | | | | On FreeBSD, Python does not ship as part of the base system but is available via the ports system, which install the binary in /usr/local/bin. Signed-off-by: R. Tyler Ballance <tyler@monkeypox.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Fix a spelling mistake in a git-p4 console messageBenjamin C Meyer2010-03-20
|/ | | | | Signed-off-by: Benjamin C Meyer <bmeyer@rim.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-p4: fix bug in symlink handlingEvan Powers2010-02-20
| | | | | | | | | | | Fix inadvertent breakage from b932705 (git-p4: stream from perforce to speed up clones, 2009-07-30) in the code that strips the trailing '\n' from p4 print on a symlink. (In practice, contents is of the form ['target\n', ''].) Signed-off-by: Evan Powers <evan.powers@gmail.com> Acked-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Typofixes outside documentation areaJunio C Hamano2010-02-03
| | | | | | | | | | | | | | | | | | | begining -> beginning canonicalizations -> canonicalization comand -> command dewrapping -> unwrapping dirtyness -> dirtiness DISCLAMER -> DISCLAIMER explicitely -> explicitly feeded -> fed impiled -> implied madatory -> mandatory mimick -> mimic preceeding -> preceding reqeuest -> request substition -> substitution Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-p4: Fix sync errors due to new server versionPal-Kristian Engstad2010-02-01
| | | | | | | | | | | | Fix sync errors due to new Perforce servers. The P4D/NTX64/2009.2/228098 (2009/12/16) server reports 'move/delete' instead of 'delete'. This causes the Perforce depot and the git repo to get out of sync. Fixed by adding the new status string. Signed-off-by: Pal-Kristian Engstad <pal_engstad@naughtydog.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* fix git-p4 editor invocationNicolas Pitre2010-01-21
| | | | | | | | The strip() is required to remove the trailing newline character, as already done elsewhere. Signed-off-by: Nicolas Pitre <nico@fluxnic.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* add -i, send-email, svn, p4, etc: use "git var GIT_EDITOR"Jonathan Nieder2009-11-13
| | | | | | | | | | Use the new "git var GIT_EDITOR" feature to decide what editor to use, instead of duplicating its logic elsewhere. This should make the behavior of commands in edge cases (e.g., editor names with spaces) a little more consistent. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* import-tars: Add support for tarballs compressed with lzma, xzIngmar Vanhassel2009-10-21
| | | | | | | | | Also handle the extensions .tlz and .txz, aliases for .tar.lzma and .tar.xz respectively. Signed-off-by: Ingmar Vanhassel <ingmar@exherbo.org> Liked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* import-tars: Add missing closing bracketIngmar Vanhassel2009-10-09
| | | | | | | | | | | | This fixes an obvious syntax error that snuck in commit 7e787953: syntax error at /home/ingmar/bin//git-import-tars line 143, near "/^$/ { " syntax error at /home/ingmar/bin//git-import-tars line 145, near "} else" syntax error at /home/ingmar/bin//git-import-tars line 152, near "}" Signed-off-by: Ingmar Vanhassel <ingmar@exherbo.org> Acked-and-Tested-by: Peter Krefting <peter@softwolves.pp.se> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'pk/fast-import-tars'Junio C Hamano2009-09-13
|\ | | | | | | | | * pk/fast-import-tars: import-tars: Allow per-tar author and commit message.
| * import-tars: Allow per-tar author and commit message.Peter Krefting2009-09-03
| | | | | | | | | | | | | | | | | | | | | | | | If the "--metainfo=<ext>" option is given on the command line, a file called "<filename.tar>.<ext>" will be used to create the commit message for "<filename.tar>", instead of using "Imported from filename.tar". The author and committer of the tar ball can also be overridden by embedding an "Author:" or "Committer:" header in the metainfo file. Signed-off-by: Peter Krefting <peter@softwolves.pp.se> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'pk/fast-import-dirs'Junio C Hamano2009-09-13
|\ \ | | | | | | | | | | | | * pk/fast-import-dirs: Add script for importing bits-and-pieces to Git.
| * | Add script for importing bits-and-pieces to Git.Peter Krefting2009-09-03
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows the user to import version history that is stored in bits and pieces in the file system, for instance snapshots of old development trees, or day-by-day backups. A configuration file is used to describe the relationship between the different files and allow describing branches and merges, as well as authorship and commit messages. Output is created in a format compatible with git-fast-import. Full documentation is provided inline in perldoc format. Signed-off-by: Peter Krefting <peter@softwolves.pp.se> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | git-p4: Avoid modules deprecated in Python 2.6.Reilly Grant2009-09-10
|/ | | | | | | | | | | | The popen2, sha and sets modules are deprecated in Python 2.6 (sha in Python 2.5). Both popen2 and sha are not actually used in git-p4. Replace usage of sets.Set with the builtin set object. The built-in set object was added in Python 2.4 and is already used in other parts of this script, so this dependency is nothing new. Signed-off-by: Reilly Grant <reillyeon@qotw.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>