All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Hausmann <simon@lst.de>
To: Jing Xue <jingxue@digizenstudio.com>
Cc: Junio C Hamano <gitster@pobox.com>, git <git@vger.kernel.org>
Subject: Re: [PATCH] Add 'git-p4.allowSubmit' to git-p4
Date: Thu, 26 Jun 2008 20:42:09 +0200	[thread overview]
Message-ID: <200806262042.13121.simon@lst.de> (raw)
In-Reply-To: <20080622181239.GA1855@jabba.hq.digizenstudio.com>

[-- Attachment #1: Type: text/plain, Size: 1597 bytes --]

On Sunday 22 June 2008 20:12:39 Jing Xue wrote:
> I'm working with a perforce repo using git-p4. There are some config
> files which I need to change locally according to my environment. I'm
> using a 'local' git branch to park these changes. And I want to avoid
> accidentally checking them into p4 just by doing "git p4 submit"
> mindlessly without realizing which branch I'm actually on.
>
> This patch adds a new git config, 'git-p4.allowSubmit', which is a
> whitelist of branch names. "git p4 submit" will only allow submissions
> from local branches on the list. Useful for preventing inadvertently
> submitting from a strictly local branch.
>
> For backward compatibility, if this config is not set at all,
> submissions from all branches are allowed.
>
> Signed-off-by: Jing Xue <jingxue@digizenstudio.com>

Acked-By: Simon Hausmann <simon@lst.de>


Simon

>  contrib/fast-import/git-p4 |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
> index d8de9f6..87ca51e 100755
> --- a/contrib/fast-import/git-p4
> +++ b/contrib/fast-import/git-p4
> @@ -687,6 +687,10 @@ class P4Submit(Command):
>          else:
>              return False
>
> +        allowSubmit = gitConfig("git-p4.allowSubmit")
> +        if len(allowSubmit) > 0 and not self.master in
> allowSubmit.split(","): +            die("%s is not in git-p4.allowSubmit"
> % self.master)
> +
>          [upstream, settings] = findUpstreamBranchPoint()
>          self.depotPath = settings['depot-paths'][0]
>          if len(self.origin) == 0:



[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2008-06-26 18:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-22 18:12 [PATCH] Add 'git-p4.allowSubmit' to git-p4 Jing Xue
2008-06-26 18:42 ` Simon Hausmann [this message]
2008-06-26 19:10   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200806262042.13121.simon@lst.de \
    --to=simon@lst.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jingxue@digizenstudio.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.