Commits on Oct 2, 2012
  1. Use filename for content filter instead of random name

    This allows to do different processing based on the filename.
    For some files it might be necessary not to do any replacements.
    ermshiperete committed Oct 2, 2012
Commits on Sep 21, 2012
  1. Optimization for processing labels

    Store the files included in the label in a variable so that we don't
    have to get them over and over again for each branch.
    ermshiperete committed Sep 21, 2012
Commits on Sep 20, 2012
  1. Create label even with non-exact matching versions

    Perforce can create a label with files from different changelists.
    If fuzzyTags is set we create the label with the newest changelist
    if we encounter such a situation.
    ermshiperete committed Sep 20, 2012
Commits on Sep 19, 2012
  1. Bugfix: Need to write parent if it is first commit

    If this is the first commit in a (existing) branch in the
    fast-import file we have to specify the "from" parent, otherwise
    git won't connect it to the existing branch. This is true at least
    for git
    ermshiperete committed Sep 19, 2012
  2. Don't write "from" lines

    This fixes a problem when importing branches: if the new branch in
    Perforce is a subset of the parent branch the import didn't work as
    expected: the entire parent branch got imported into git. The reason
    is the "from" line.
    This means that we shouldn't write the "from" line. According to git
    documentation these lines can be omitted. In that case it will take
    the previous commit of the current branch. Since Perforce only allows
    linear history this should be sufficient.
    If we start a new branch we list all the files included in that branch,
    so we can't add "from" if we want the trees in Perforce and git to match
    (otherwise git starts out with the "from" tree instead of an empty tree).
    ermshiperete committed Sep 19, 2012
Commits on Sep 4, 2012
  1. Bugfix

    contentFilterDir wasn't defined
    ermshiperete committed Sep 4, 2012
Commits on Jul 6, 2012
Commits on Jul 5, 2012
Commits on Jul 4, 2012
Commits on Jul 2, 2012
  1. Oops - fix typo

    ermshiperete committed Jul 2, 2012
  2. Merge pull request #17 from jbert/master

    Fix option
    ermshiperete committed Jul 2, 2012
  3. Add filters

    This change adds three new parameters to the sync (and clone)
    command: --tree-filter, --msg-filter, and --content-filter.
    All three take the path to a filter script. Note that the path
    should be an absolute path for the scripts to work correctly.
    These filter scripts allow to apply tree, log message, and/or
    content filters during the import of a change.
    A tree filter is a script that gets the path of one file (in p4
    notation, e.g. //depot/branch/file.txt) on stdin. It can output
    a modified path on stdout, or return an empty string to ignore
    this file.
    The msg filter is a script that gets the commit message on stdin
    and returns a modified commit message.
    The content filter gets called for text files and is passed the
    name of a temporary file on stdin and can modify that file.
    These filters are useful when importing an entire p4 repo. They
    allow to rearrange the location of some files (or ignore files
    that accidentally got submitted in p4). The content filter is
    useful to do whitespace cleanup or remove/replace some file
    content that should not be in a repo, e.g. passwords.
    ermshiperete committed Jul 2, 2012
Commits on Apr 23, 2012
Commits on Mar 8, 2012
  1. Fix option.

    Use the '-H' on the p4 cmdline option for host, not -h, as per usage:
            -H host         set host name (default $P4HOST)
    John Berthels committed Mar 8, 2012
Commits on Nov 10, 2011
  1. Implement merge commits

    Handle p4 branch and integrate changes as merge commits when
    detecting branches.
    ermshiperete committed Nov 9, 2011
Commits on Nov 8, 2011
  1. Fix initial checkout of a branch

    Previously we got an error when trying to clone with detection of
    branches turned on because the branch the import created was not
    named master. We now dynamically set the name of the main branch
    based on last imported branch.
    ermshiperete committed Nov 8, 2011
  2. Improve import of first changelist

    When we import changelist @1 we can use the commit message from
    p4 rather then our artificial initial one because we know that
    this is the first one - there can't be any before that.
    ermshiperete committed Nov 8, 2011
  3. Fix problem with branches

    ermshiperete committed Nov 8, 2011
  4. Fix bug with marks

    We use marks in fast-import file for both changes and notes so we
    have to increment by 2.
    ermshiperete committed Nov 8, 2011
  5. Add new option --fuzzy-tags

    When the files included by the view spec of a label doesn't match
    the files really included in the label, we normally don't create
    a tag.
    When the option --fuzzy-tags is specified on the command line all
    files and revisions included in the label are compared with the
    files and revisions in the repository. If all files match we still
    create the label. In other words, we create a label if the files
    included in the label is a subset of the files in the repository.
    ermshiperete committed Nov 8, 2011
  6. Don't get user list from p4 server with --no-getuserlist

    When we get an error processing the cached user list but the parameter
    --no-getuserlist was specified on the command line, we still should
    not get the user list from the p4 server. Instead just quit processing
    the rest of the cached list.
    ermshiperete committed Nov 7, 2011
  7. Fix utf16 file patch

    We need to escape the filename when we deal with utf16 files.
    ermshiperete committed Nov 7, 2011
  8. Fix creating tags from labels

    If the label specifies a view limiting the depot we should use that
    view when comparing the changelist with the list of files from the
    ermshiperete committed Nov 7, 2011
  9. Add new parameter --no-getuserlist to sync/rebase command

    When the parameter --no-getuserlist is passed to the git-p4 sync or
    rebase command, the cached userlist (~/.gitp4-usercache.txt) will
    be used even when an author of a commit can't be find in the cached
    list. Normally the userlist is retrieved from Perforce when an
    author can't be found. The use of the parameter allows the use of
    hand-tailored user lists that contain historical users that are no
    longer in the Perforce user database.
    ermshiperete committed Nov 4, 2011
  10. Renamed tests

    ermshiperete committed Sep 20, 2011
  11. Improve handling of branches

    We don't allow nested branches. If we encounter one we simply assume
    it's because of a bad branch spec that lists subdirectories
    separately. In that case we remove the branch from our list.
    ermshiperete committed Sep 6, 2011
  12. git-p4: commit time should be most recent p4 change time

    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 <>
    Acked-by: Luke Diamand <>
    Signed-off-by: Junio C Hamano <>
    Pete Wyckoff committed with ermshiperete Jul 31, 2011
  13. git-p4: reinterpret confusing p4 message

    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 <>
    Signed-off-by: Junio C Hamano <>
    Pete Wyckoff committed with ermshiperete Feb 19, 2011
  14. git-p4: fix key error for p4 problem

    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
    Signed-off-by: Pete Wyckoff <>
    Signed-off-by: Junio C Hamano <>
    Pete Wyckoff committed with ermshiperete Feb 19, 2011
  15. git-p4: accommodate new move/delete type in p4

    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 <>
    Acked-By: Tor Arvid Lund <>
    Signed-off-by: Junio C Hamano <>
    Pete Wyckoff committed with ermshiperete Feb 19, 2011
  16. git-p4: Allow branch definition with git config

    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 <>
    Signed-off-by: Junio C Hamano <>
    vhda committed with ermshiperete Aug 18, 2011
  17. git-p4: Allow filtering Perforce branches by user

    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 <>
    Acked-by: Pete Wyckoff <>
    Signed-off-by: Junio C Hamano <>
    vhda committed with ermshiperete Aug 18, 2011