git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCHv1] git-p4: workaround p4 removal of client directory

From
Luke Diamand <luke@diamand.org>
Date
Apr 29, 2016, 07:39 UTC
Message-ID
<CAE5ih78yvMe2MLqE6+KOnPUd+D_0-cO5-LY2WsbjfMmTMqBK9w@mail.gmail.com>
In-Reply-To
<1461915626-10250-2-git-send-email-luke@diamand.org>
Adding correct email for Jacob.
On 29 April 2016 at 08:40, Luke Diamand <luke@diamand.org> wrote:
Show 36 quoted lines
> On some platforms, "p4 sync -f" will remove the workspace
> directory after we have just created it; on some it won't.
> This causes problems later when git finds itself in an
> orphaned directory.
>
> Workaround this by cd'ing back to the directory after
> the "p4 sync -f".
>
> Signed-off-by: Luke Diamand <luke@diamand.org>
> ---
>  git-p4.py | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/git-p4.py b/git-p4.py
> index 527d44b..2b75a61 100755
> --- a/git-p4.py
> +++ b/git-p4.py
> @@ -1,4 +1,4 @@
> -#!/usr/bin/env python
> +#!/usr/bin/env python2
>  #
>  # git-p4.py -- A tool for bidirectional operation between a Perforce depot and git.
>  #
> @@ -1956,6 +1956,9 @@ class P4Submit(Command, P4UserMap):
>              if new_client_dir:
>                  # old one was destroyed, and maybe nobody told p4
>                  p4_sync("...", "-f")
> +
> +                # sometimes p4 will unlink the directory and recreate it
> +                chdir(self.clientPath, is_client_path=True)
>              else:
>                  p4_sync("...")
>          self.check()
> --
> 2.8.1.218.gd2cea43.dirty
>
Previous: Luke DiamandNext: Luke Diamand
Message 3 of 4 in “[PATCHv1] git-p4: workaround p4 removal of client directory”
  1. Luke DiamandApr 29, 2016
  2. Luke DiamandApr 29, 2016
  3. Luke DiamandApr 29, 2016
  4. Luke DiamandApr 29, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.