1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-21 09:16:10 +02:00
Commit Graph

139 Commits

Author SHA1 Message Date
Junio C Hamano 8e3e28b2f3 Merge branch 'ao/p4-has-branch-prefix-fix' into maint
A bug, which caused "git p4" while running under verbose mode to
report paths that are omitted due to branch prefix incorrectly, has
been fixed; the command said "Ignoring file outside of prefix" for
paths that are _inside_.

* ao/p4-has-branch-prefix-fix:
  git-p4: correct hasBranchPrefix verbose output
2016-07-11 10:44:16 -07:00
Andrew Oakley 09667d013c git-p4: correct hasBranchPrefix verbose output
The logic here was inverted, you got a message saying the file is
ignored for each file that is not ignored.

Signed-off-by: Andrew Oakley <aoakley@roku.com>
Acked-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-22 09:45:15 -07:00
Junio C Hamano 7a959426b6 Merge branch 'ls/p4-lfs'
Recent update to Git LFS broke "git p4" by changing the output from
its "lfs pointer" subcommand.

* ls/p4-lfs:
  git-p4: fix Git LFS pointer parsing
  travis-ci: express Linux/OS X dependency versions more clearly
  travis-ci: update Git-LFS and P4 to the latest version
2016-05-10 13:40:29 -07:00
Lars Schneider 82f2567e3d git-p4: fix Git LFS pointer parsing
Git LFS 1.2.0 removed a preamble from the output of the 'git lfs pointer'
command [1] which broke the parsing of this output. Adjust the parser
to support the old and the new format.

Please note that this patch slightly changes the second return parameter
from a list of LF terminated strings to a single string that contains
a number of LF characters.

[1] da2935d9a7

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Helped-by: Sebastian Schuberth <sschuberth@gmail.com>
Helped-by: Ben Woosley <ben.woosley@gmail.com>
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-04-28 10:03:13 -07:00
Jan Durovec 26e6a27d69 git-p4: add P4 jobs to git commit message
When migrating from Perforce to git the information about P4 jobs
associated with P4 changelists is lost.

Having these jobs listed on messages of related git commits enables smooth
migration for projects that take advantage of e.g. JIRA integration
(which uses jobs on Perforce side and parses commit messages on git side).

The jobs are added to the message in the same format as is expected when
migrating in the reverse direction.

Signed-off-by: Jan Durovec <jan.durovec@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-04-19 13:41:00 -07:00
Junio C Hamano 1d851b9d30 Merge branch 'ls/p4-map-user'
"git p4" now allows P4 author names to be mapped to Git author
names.

* ls/p4-map-user:
  git-p4: map a P4 user to Git author name and email address
2016-04-06 11:39:05 -07:00
Lars Schneider 10d08a149d git-p4: map a P4 user to Git author name and email address
Map a P4 user to a specific name and email address in Git with the
"git-p4.mapUser" config. The config value must be a string adhering
to the format "p4user = First Lastname <email@address.com>".

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Reviewed-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-03-15 11:45:13 -07:00
Romain Picard a02b8bc4d7 git-p4.py: add support for filetype change
After changing the type of a file in the git repository, it is not possible to
"git p4 publish" the commit to perforce. This is due to the fact that the git
"T" status is not handled in git-p4.py. This can typically occur when replacing
an existing file with a symbolic link.

The "T" modifier is now supported in git-p4.py. When a file type has changed,
inform perforce with the "p4 edit -f auto" command.

Signed-off-by: Romain Picard <romain.picard@oakbits.com>
Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-13 09:06:54 -08:00
Junio C Hamano aecb9979df Merge branch 'sh/p4-multi-depot'
"git p4" when interacting with multiple depots at the same time
used to incorrectly drop changes.

* sh/p4-multi-depot:
  git-p4: reduce number of server queries for fetches
  git-p4: support multiple depot paths in p4 submit
  git-p4: failing test case for skipping changes with multiple depots
2015-12-28 13:58:58 -08:00
Sam Hocevar 1f90a64891 git-p4: reduce number of server queries for fetches
When fetching changes from a depot using a full client spec, there
is no need to perform as many queries as there are top-level paths
in the client spec.  Instead we query all changes in chronological
order, also getting rid of the need to sort the results and remove
duplicates.

Signed-off-by: Sam Hocevar <sam@hocevar.net>
Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-21 11:26:55 -08:00
Sam Hocevar cbc692425c git-p4: support multiple depot paths in p4 submit
When submitting from a repository that was cloned using a client spec,
use the full list of paths when ruling out files that are outside the
view.  This fixes a bug where only files pertaining to the first path
would be included in the p4 submit.

Signed-off-by: Sam Hocevar <sam@hocevar.net>
Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-21 11:26:36 -08:00
Junio C Hamano a899d500c6 Merge branch 'ls/p4-keep-empty-commits'
"git p4" used to import Perforce CLs that touch only paths outside
the client spec as empty commits.  It has been corrected to ignore
them instead, with a new configuration git-p4.keepEmptyCommits as a
backward compatibility knob.

* ls/p4-keep-empty-commits:
  git-p4: add option to keep empty commits
2015-12-15 08:02:19 -08:00
Lars Schneider 4ae048e67e git-p4: add option to keep empty commits
A changelist that contains only excluded files due to a client spec was
imported as an empty commit. Fix that issue by ignoring these commits.
Add option "git-p4.keepEmptyCommits" to make the previous behavior
available.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Helped-by: Pete Harlan
Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-10 10:45:02 -08:00
Jeff King 40fdcc5357 Merge branch 'maint'
* maint:
  http: treat config options sslCAPath and sslCAInfo as paths
  Documentation/diff: give --word-diff-regex=. example
  filter-branch: deal with object name vs. pathname ambiguity in tree-filter
  check-ignore: correct documentation about output
  git-p4: clean up after p4 submit failure
  git-p4: work with a detached head
  git-p4: add option to system() to return subshell status
  git-p4: add failing test for submit from detached head
  remote-http(s): support SOCKS proxies
  t5813: avoid creating urls that break on cygwin
  Escape Git's exec path in contrib/rerere-train.sh script
  allow hooks to ignore their standard input stream
  rebase-i-exec: Allow space in SHELL_PATH
  Documentation: make environment variable formatting more consistent
2015-12-01 17:32:38 -05:00
Jeff King 908a6e4156 Merge branch 'eg/p4-submit-catch-failure' into maint
Just like the working tree is cleaned up when the user cancelled
submission in P4Submit.applyCommit(), clean up the mess if "p4
submit" fails.

* eg/p4-submit-catch-failure:
  git-p4: clean up after p4 submit failure
2015-12-01 17:24:21 -05:00
Jeff King 5b228f956a Merge branch 'ld/p4-detached-head' into maint
Make git-p4 work on a detached head.

* ld/p4-detached-head:
  git-p4: work with a detached head
  git-p4: add option to system() to return subshell status
  git-p4: add failing test for submit from detached head
2015-12-01 17:21:29 -05:00
GIRARD Etienne b7638fed42 git-p4: clean up after p4 submit failure
When "p4 submit" command fails in P4Submit.applyCommit, the
workspace is left with the changes.  We already have code to revert
the changes to the workspace when the user decides to cancel
submission by aborting the editor that edits the change description,
and we should treat the "p4 submit" failure the same way.

Clean the workspace if p4_write_pipe raised SystemExit, so that the
user don't have to do it themselves.

Signed-off-by: GIRARD Etienne <egirard@murex.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Jeff King <peff@peff.net>
2015-11-24 15:41:59 -05:00
Luke Diamand 00ad6e3182 git-p4: work with a detached head
When submitting, git-p4 finds the current branch in
order to know if it is allowed to submit (configuration
"git-p4.allowSubmit").

On a detached head, detecting the branch would fail, and
git-p4 would report a cryptic error.

This change teaches git-p4 to recognise a detached head and
submit successfully.

Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Jeff King <peff@peff.net>
2015-11-24 15:20:15 -05:00
Luke Diamand cbff4b25e4 git-p4: add option to system() to return subshell status
Add an optional parameter ignore_error to the git-p4 system()
function. If used, it will return the subshell exit status
rather than throwing an exception.

Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Jeff King <peff@peff.net>
2015-11-24 15:20:15 -05:00
Junio C Hamano c7bdbd6f92 Merge branch 'ls/p4-translation-failure' into maint
Work around "git p4" failing when the P4 depot records the contents
in UTF-16 without UTF-16 BOM.

* ls/p4-translation-failure:
  git-p4: handle "Translation of file content failed"
  git-p4: add test case for "Translation of file content failed" error
2015-11-03 15:32:32 -08:00
Junio C Hamano 04bba3a12b Merge branch 'ld/p4-import-labels' into maint
Correct "git p4 --detect-labels" so that it does not fail to create
a tag that points at a commit that is also being imported.

* ld/p4-import-labels:
  git-p4: fix P4 label import for unprocessed commits
  git-p4: do not terminate creating tag for unknown commit
  git-p4: failing test for ignoring invalid p4 labels
2015-11-03 15:32:28 -08:00
Junio C Hamano 922239e7da Merge branch 'dk/p4-import-ctypes'
"git-p4" tried to use from ctypes module without first importing
it.

* dk/p4-import-ctypes:
  git-p4: import the ctypes module
2015-10-26 15:55:26 -07:00
Dennis Kaarsemaker 4b07cd230a git-p4: import the ctypes module
The ctypes module is used on windows to calculate free disk space,
so it must be imported.  We won't need it on other platforms, but
the module is available in Python 2.5 and newer, so importing it
unconditionally is harmless.

Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-20 12:55:22 -07:00
Junio C Hamano 6ff518f593 Merge branch 'ls/p4-lfs'
Teach "git p4" to send large blobs outside the repository by
talking to Git LFS.

* ls/p4-lfs:
  git-p4: add Git LFS backend for large file system
  git-p4: add support for large file systems
  git-p4: check free space during streaming
  git-p4: add file streaming progress in verbose mode
  git-p4: return an empty list if a list config has no values
  git-p4: add gitConfigInt reader
  git-p4: add optional type specifier to gitConfig reader
2015-10-15 15:43:53 -07:00
Junio C Hamano 00272a6339 Merge branch 'ls/p4-translation-failure'
Work around "git p4" failing when the P4 depot records the contents
in UTF-16 without UTF-16 BOM.

* ls/p4-translation-failure:
  git-p4: handle "Translation of file content failed"
  git-p4: add test case for "Translation of file content failed" error
2015-10-15 15:43:34 -07:00
Junio C Hamano 98f9556a44 Merge branch 'ls/p4-path-encoding'
"git p4" learned to reencode the pathname it uses to communicate
with the p4 depot with a new option.

* ls/p4-path-encoding:
  git-p4: use replacement character for non UTF-8 characters in paths
  git-p4: improve path encoding verbose output
  git-p4: add config git-p4.pathEncoding
2015-10-07 13:38:19 -07:00
Junio C Hamano 5e1288ac9e Merge branch 'ld/p4-import-labels'
Correct "git p4 --detect-labels" so that it does not fail to create
a tag that points at a commit that is also being imported.

* ld/p4-import-labels:
  git-p4: fix P4 label import for unprocessed commits
  git-p4: do not terminate creating tag for unknown commit
  git-p4: failing test for ignoring invalid p4 labels
2015-10-05 12:30:07 -07:00
Lars Schneider b47d807d20 git-p4: add Git LFS backend for large file system
Add example implementation including test cases for the large file
system using Git LFS.

Pushing files to the Git LFS server is not tested.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-03 10:21:14 -07:00
Lars Schneider a5db4b127b git-p4: add support for large file systems
Perforce repositories can contain large (binary) files. Migrating these
repositories to Git generates very large local clones. External storage
systems such as Git LFS [1], Git Fat [2], Git Media [3], git-annex [4]
try to address this problem.

Add a generic mechanism to detect large files based on extension,
uncompressed size, and/or compressed size.

[1] https://git-lfs.github.com/
[2] https://github.com/jedbrown/git-fat
[3] https://github.com/alebedev/git-media
[4] https://git-annex.branchable.com/

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>

Conflicts:
	Documentation/git-p4.txt
	git-p4.py
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-03 10:21:14 -07:00
Lars Schneider 4d25dc4475 git-p4: check free space during streaming
git-p4 will just halt if there is not enough disk space while
streaming content from P4 to Git. Add a check to ensure at least
4 times (arbitrarily chosen) the size of a streamed file is available.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-03 10:21:13 -07:00
Lars Schneider d2176a5060 git-p4: add file streaming progress in verbose mode
If a file is streamed from P4 to Git then the verbose mode prints
continuously the progress as percentage like this:
//depot/file.bin 20% (10 MB)

Upon completion the progress is overwritten with depot source, local
file and size like this:
//depot/file.bin --> local/file.bin (10 MB)

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-03 10:21:13 -07:00
Lars Schneider 7960e70710 git-p4: return an empty list if a list config has no values
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-03 10:21:13 -07:00
Lars Schneider cb1dafdfda git-p4: add gitConfigInt reader
Add a git config reader for integer variables. Please note that the
git config implementation automatically supports k, m, and g suffixes.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-03 10:21:13 -07:00
Lars Schneider 692e17964d git-p4: add optional type specifier to gitConfig reader
The functions "gitConfig" and "gitConfigBool" are almost identical.
Make "gitConfig" more generic by adding an optional type specifier.
Use the type specifier "--bool" with "gitConfig" to implement
"gitConfigBool. This prepares the implementation of other type
specifiers such as "--int".

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-10-03 10:20:00 -07:00
Lars Schneider 1f5f390711 git-p4: handle "Translation of file content failed"
A P4 repository can get into a state where it contains a file with
type UTF-16 that does not contain a valid UTF-16 BOM. If git-p4
attempts to retrieve the file then the process crashes with a
"Translation of file content failed" error.

More info here: http://answers.perforce.com/articles/KB/3117

Fix this by detecting this error and retrieving the file as binary
instead. The result in Git is the same.

Known issue: This works only if git-p4 is executed in verbose mode.
In normal mode no exceptions are thrown and git-p4 just exits.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-09-22 12:15:17 -07:00
Lars Schneider 4cb870d804 git-p4: use replacement character for non UTF-8 characters in paths
If non UTF-8 characters are detected in paths then replace them with
a placeholder instead of throwing a UnicodeDecodeError
exception. This restores the original (implicit) implementation that
was broken in 00a9403.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Reviewed-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-09-21 13:24:11 -07:00
Lars Schneider 00a9403a10 git-p4: improve path encoding verbose output
If a path with non-ASCII characters is detected then print the
encoding and the encoded string in verbose mode.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-09-16 15:53:08 -07:00
Lars Schneider a9e38359e3 git-p4: add config git-p4.pathEncoding
Perforce keeps the encoding of a path as given by the originating OS.
Git expects paths encoded as UTF-8. Add a config to tell git-p4 what
encoding Perforce had used for the paths. This encoding is used to
transcode the paths to UTF-8. As an example, Perforce on Windows often
uses “cp1252” to encode path names.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-09-03 14:11:49 -07:00
Luke Diamand b43702ac56 git-p4: fix P4 label import for unprocessed commits
With --detect-labels enabled, git-p4 will try to create tags
using git fast-import by writing a "tag" clause to the
fast-import stream.

If the commit that the tag references has not yet actually
been processed by fast-import, then the tag can't be created
and git-p4 fails to import the P4 label.

Teach git-p4 to use fast-import "marks" when creating tags
which reference commits created during the current run of the
program.

Commits created before the current run are still referenced
in the old way using a normal git commit.

Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-28 12:02:58 -07:00
Luke Diamand 9ab1cfe505 git-p4: do not terminate creating tag for unknown commit
If p4 reports a tag for a commit that git-p4 does not know
about (e.g. because it references a P4 changelist that was
imported prior to the point at which the repo was cloned into
git), make sure that the error is correctly caught and handled.
rather than just crashing.

Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-28 12:02:56 -07:00
Lars Schneider a0a50d873c git-p4: honor core.ignorecase when using P4 client specs
Perforce depot may record paths in mixed cases, e.g. "p4 files" may
show that there are these two paths:

   //depot/Path/to/file1
   //depot/pATH/to/file2

and with "p4" or "p4v", these end up in the same directory, e.g.

   //depot/Path/to/file1
   //depot/Path/to/file2

which is the desired outcome on case insensitive systems.

If git-p4 is used with client spec "//depot/Path/...", however, then
all files not matching the case in the client spec are ignored (in
the example above "//depot/pATH/to/file2").

Fix this by using the path case that appears first in lexicographical
order when core.ignorecase is set to true. This behavior is consistent
with "p4" and "p4v".

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-08-28 10:33:16 -07:00
Junio C Hamano b79bbed185 Merge branch 'ld/p4-changes-block-size'
More Perforce row number limit workaround for "git p4".

* ld/p4-changes-block-size:
  git-p4: fixing --changes-block-size handling
  git-p4: add tests for non-numeric revision range
  git-p4: test with limited p4 server results
  git-p4: additional testing of --changes-block-size
2015-06-24 12:21:57 -07:00
Junio C Hamano 8f436d1374 Merge branch 'mt/p4-depotFile-at-version'
* mt/p4-depotFile-at-version:
  p4: retrieve the right revision of the file in UTF-16 codepath
2015-06-11 09:29:55 -07:00
Luke Diamand 1051ef0063 git-p4: fixing --changes-block-size handling
The --changes-block-size handling was intended to help when
a user has a limited "maxscanrows" (see "p4 group"). It used
"p4 changes -m $maxchanges" to limit the number of results.

Unfortunately, it turns out that the "maxscanrows" and "maxresults"
limits are actually applied *before* the "-m maxchanges" parameter
is considered (experimentally).

Fix the block-size handling so that it gets blocks of changes
limited by revision number ($Start..$Start+$N, etc). This limits
the number of results early enough that both sets of tests pass.

Note that many other Perforce operations can fail for the same
reason (p4 print, p4 files, etc) and it's probably not possible
to workaround this. In the real world, this is probably not
usually a problem.

Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-06-10 08:29:17 -07:00
Junio C Hamano 9fb0a798a7 Merge branch 'ld/p4-editor-multi-words'
Unlike "$EDITOR" and "$GIT_EDITOR" that can hold the path to the
command and initial options (e.g. "/path/to/emacs -nw"), 'git p4'
did not let the shell interpolate the contents of the environment
variable that name the editor "$P4EDITOR" (and "$EDITOR", too).
Make it in line with the rest of Git, as well as with Perforce.

* ld/p4-editor-multi-words:
  git-p4: tests: use test-chmtime in place of touch
  git-p4: fix handling of multi-word P4EDITOR
  git-p4: add failing test for P4EDITOR handling
2015-06-05 12:17:38 -07:00
Miguel Torroja f5f53f1410 p4: retrieve the right revision of the file in UTF-16 codepath
Fixing bug with UTF-16 files when they are retrieved by git-p4.  It
was always getting the tip version of the file and the history of
the file was lost.

Signed-off-by: Miguel Torroja <miguel.torroja@gmail.com>
Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-05-27 16:23:02 -07:00
Luke Diamand 2dade7a7b2 git-p4: fix handling of multi-word P4EDITOR
This teaches git-p4 to pass the P4EDITOR variable to the
shell for expansion, so that any command-line arguments are
correctly handled. Without this, git-p4 can only launch the
editor if P4EDITOR is solely the path to the binary, without
any arguments.

This also adjusts t9805, which relied on the previous behaviour.

Suggested-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-05-24 11:50:12 -07:00
Junio C Hamano 0495983679 Merge branch 'va/p4-client-path'
git p4 attempts to better handle branches in Perforce.

* va/p4-client-path:
  git-p4: improve client path detection when branches are used
  t9801: check git-p4's branch detection with client spec enabled
2015-05-11 14:23:48 -07:00
Junio C Hamano 120c585b22 Merge branch 'ls/p4-changes-block-size'
"git p4" learned "--changes-block-size <n>" to read the changes in
chunks from Perforce, instead of making one call to "p4 changes"
that may trigger "too many rows scanned" error from Perforce.

* ls/p4-changes-block-size:
  git-p4: use -m when running p4 changes
2015-05-11 14:23:46 -07:00
Vitor Antunes cd88410618 git-p4: improve client path detection when branches are used
Perforce allows client side file/directory remapping through
the use of the client view definition that is part of the
user's client spec.

To support this functionality while branch detection is
enabled it is important to determine the branch location in
the workspace such that the correct files are patched before
Perforce submission. Perforce provides a command that
facilitates this process: p4 where.

This patch does two things to fix improve file location
detection when git-p4 has branch detection and use of client
spec enabled:

 1. Enable usage of "p4 where" when Perforce branches exist
    in the git repository, even when client specification is
    used. This makes use of the already existing function
    p4Where.

 2. Allow identifying partial matches of the branch's depot
    path while processing the output of "p4 where". For
    robustness, paths will only match if ending in "/...".

Signed-off-by: Vitor Antunes <vitor.hda@gmail.com>
Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-04-23 10:17:02 -07:00