public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: "Amadeusz Żołnowski" <aidecoe@aidecoe•name>
Cc: git@vger•kernel.org, Luke Diamand <luke@diamand•org>
Subject: Re: [PATCH] git-p4.py: Make submit working on bare repository
Date: Fri, 19 Feb 2016 14:44:22 -0800	[thread overview]
Message-ID: <xmqq7fi0b9rt.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <1455919074-5683-1-git-send-email-aidecoe@aidecoe.name> ("Amadeusz Żołnowski"'s message of "Fri, 19 Feb 2016 21:57:54 +0000")

Amadeusz Żołnowski <aidecoe@aidecoe•name> writes:

> git-p4 can be successfully used from bare repository (which may act as a
> bridge between Perforce repository and pure Git repositories). After
> submitting changelist to Perforce, git-p4 performs unconditional rebase
> which obviously fails.
>
> Perform rebase only on non-bare repositories, so submit command can be
> successful on bare repository.

It is obvious that an attempt to run rebase would fail in a bare
repository, and skipping it would obviously make it not fail.

I think that part is well understood.

What is unclear is what the ramification of _not_ rebasing after
submitting is.

In other words, why do we have to rebase after submitting when we
are in a non-bare repository?  There must be a reason behind it,
i.e. "If we do not rebase, then the repository would be in a state
where future operations like X and Y do not work correctly because
of Z".

And why does that same reason Z not apply when we submit from a bare
repository?

A possible explanation might be that X and Y are operations that
happen only in a non-bare repository that we do not have to worry
about happening in a bare repository after we finish submitting.

But these X, Y and Z are left unexplained--that is what is unclear
in the original proposed log message, and it is still unclear in the
above update.

Thanks.



> Signed-off-by: Amadeusz Żołnowski <aidecoe@aidecoe•name>
> ---
>  git-p4.py | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/git-p4.py b/git-p4.py
> index c33dece..e00cd02 100755
> --- a/git-p4.py
> +++ b/git-p4.py
> @@ -2059,8 +2059,9 @@ class P4Submit(Command, P4UserMap):
>                  sync.branch = self.branch
>              sync.run([])
>  
> -            rebase = P4Rebase()
> -            rebase.rebase()
> +            if not gitConfigBool("core.bare"):
> +                rebase = P4Rebase()
> +                rebase.rebase()
>  
>          else:
>              if len(applied) == 0:

  reply	other threads:[~2016-02-19 22:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-17 22:46 [PATCH] git-p4.py: Don't try to rebase on submit from bare repository Amadeusz Żołnowski
2016-02-19  9:47 ` Luke Diamand
2016-02-19 17:21   ` Junio C Hamano
2016-02-19 18:27     ` Amadeusz Żołnowski
2016-02-19 18:40       ` Eric Sunshine
2016-02-19 21:57         ` [PATCH] git-p4.py: Make submit working on " Amadeusz Żołnowski
2016-02-19 22:44           ` Junio C Hamano [this message]
2016-02-20 11:00             ` Amadeusz Żołnowski
2016-02-21  7:36               ` Junio C Hamano
2016-02-22 18:50                 ` Amadeusz Żołnowski
2016-02-23  6:59                   ` Junio C Hamano
2016-02-23 12:05                     ` Luke Diamand
2016-02-23 20:56                       ` Amadeusz Żołnowski
2016-02-28  4:26                         ` Luke Diamand
2016-02-28 20:46                           ` Amadeusz Żołnowski
2016-02-29 15:29                             ` Luke Diamand
2016-04-12 23:25                               ` Junio C Hamano
2016-04-13 20:27                                 ` Amadeusz Żołnowski
2016-04-13 21:47                                   ` Junio C Hamano
2016-06-07 20:32                                     ` Amadeusz Żołnowski

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=xmqq7fi0b9rt.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=aidecoe@aidecoe$(echo .)name \
    --cc=git@vger$(echo .)kernel.org \
    --cc=luke@diamand$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox