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

Re: [PATCH] git-p4.py: Make submit working on bare repository

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 19, 2016, 22:44 UTC
Message-ID
<xmqq7fi0b9rt.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1455919074-5683-1-git-send-email-aidecoe@aidecoe.name>
Amadeusz Żołnowski <aidecoe@aidecoe.name> writes:
Show 7 quoted lines
> 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.
Show 21 quoted lines
> 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:
Previous: Amadeusz ŻołnowskiNext: Amadeusz Żołnowski
Message 7 of 20 in “git-p4.py: Don't try to rebase on submit from bare repository”
  1. git-p4.py: Don't try to rebase on submit from bare repositoryAmadeusz Żołnowski, Feb 17, 2016
  2. Luke DiamandFeb 19, 2016
  3. Junio C HamanoFeb 19, 2016
  4. git-p4.py: Don't try to rebase on submit from bare repositoryAmadeusz Żołnowski, Feb 19, 2016
  5. Eric SunshineFeb 19, 2016
  6. git-p4.py: Make submit working on bare repositoryAmadeusz Żołnowski, Feb 19, 2016
  7. Junio C HamanoFeb 19, 2016
  8. Amadeusz ŻołnowskiFeb 20, 2016
  9. Junio C HamanoFeb 21, 2016
  10. Amadeusz ŻołnowskiFeb 22, 2016
  11. Junio C HamanoFeb 23, 2016
  12. Luke DiamandFeb 23, 2016
  13. Amadeusz ŻołnowskiFeb 23, 2016
  14. Luke DiamandFeb 28, 2016
  15. Amadeusz ŻołnowskiFeb 28, 2016
  16. Luke DiamandFeb 29, 2016
  17. Junio C HamanoApr 12, 2016
  18. Amadeusz ŻołnowskiApr 13, 2016
  19. Junio C HamanoApr 13, 2016
  20. Amadeusz ŻołnowskiJun 7, 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.