Skip to content

p4: respect init.defaultBranch #782

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

dscho
Copy link
Member

@dscho dscho commented Nov 7, 2020

Just something I noticed while working on the big master -> main rename in the test suite.

Cc: Luke Diamand luke@diamand.org

In `git p4 clone`, we hard-code the branch name `master` instead of
looking what the _actual_ initial branch name is. Let's fix that.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho
Copy link
Member Author

dscho commented Nov 8, 2020

/submit

@gitgitgadget
Copy link

gitgitgadget bot commented Nov 8, 2020

Submitted as pull.782.git.1604824911359.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git pr-782/dscho/git-p4-and-init.defaultBranch-v1

To fetch this version to local tag pr-782/dscho/git-p4-and-init.defaultBranch-v1:

git fetch --no-tags https://github.com/gitgitgadget/git tag pr-782/dscho/git-p4-and-init.defaultBranch-v1

@dscho dscho mentioned this pull request Nov 8, 2020
19 tasks
@gitgitgadget
Copy link

gitgitgadget bot commented Nov 9, 2020

On the Git mailing list, Junio C Hamano wrote (reply to this):

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:

> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> In `git p4 clone`, we hard-code the branch name `master` instead of
> looking what the _actual_ initial branch name is. Let's fix that.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---

Makes sense.  Will queue.  Thanks.

>     p4: respect init.defaultBranch
>     
>     Just something I noticed while working on the big master -> main rename
>     in the test suite.
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-782%2Fdscho%2Fgit-p4-and-init.defaultBranch-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-782/dscho/git-p4-and-init.defaultBranch-v1
> Pull-Request: https://github.com/gitgitgadget/git/pull/782
>
>  git-p4.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/git-p4.py b/git-p4.py
> index 4433ca53de..52ddb1d7b2 100755
> --- a/git-p4.py
> +++ b/git-p4.py
> @@ -4186,7 +4186,7 @@ def run(self, args):
>  
>          # create a master branch and check out a work tree
>          if gitBranchExists(self.branch):
> -            system([ "git", "branch", "master", self.branch ])
> +            system([ "git", "branch", currentGitBranch(), self.branch ])
>              if not self.cloneBare:
>                  system([ "git", "checkout", "-f" ])
>          else:
>
> base-commit: 7f7ebe054af6d831b999d6c2241b9227c4e4e08d

@gitgitgadget
Copy link

gitgitgadget bot commented Nov 9, 2020

This branch is now known as js/p4-default-branch.

@gitgitgadget
Copy link

gitgitgadget bot commented Nov 9, 2020

This patch series was integrated into seen via git@58f2882.

@gitgitgadget
Copy link

gitgitgadget bot commented Nov 9, 2020

This patch series was integrated into next via git@a4b08b4.

@gitgitgadget
Copy link

gitgitgadget bot commented Nov 11, 2020

This patch series was integrated into seen via git@bf9657e.

@gitgitgadget
Copy link

gitgitgadget bot commented Nov 11, 2020

This patch series was integrated into seen via git@ca8870d.

@gitgitgadget
Copy link

gitgitgadget bot commented Nov 11, 2020

This patch series was integrated into next via git@ca8870d.

@gitgitgadget
Copy link

gitgitgadget bot commented Nov 11, 2020

This patch series was integrated into master via git@ca8870d.

@gitgitgadget gitgitgadget bot added the master label Nov 11, 2020
@gitgitgadget gitgitgadget bot closed this Nov 11, 2020
@gitgitgadget
Copy link

gitgitgadget bot commented Nov 11, 2020

Closed via ca8870d.

@dscho dscho deleted the git-p4-and-init.defaultBranch branch November 12, 2020 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant