[Rpm-maint] [rpm-software-management/rpm] Revert branch creation in %autosetup -S git (PR #2154)

Michal Domonkos notifications at github.com
Thu Aug 18 11:37:02 UTC 2022


> As mentioned in [#854 (comment)](https://github.com/rpm-software-management/rpm/pull/854#issuecomment-1209089265), can't we just do `git checkout --track -b rpm-build` rather than all this explicit branch dance? As in, revert [8b9da98](https://github.com/rpm-software-management/rpm/commit/8b9da98e4c9e256c7c6ecca7f1e5bdbbce29e5da) and then:

Oh, I didn't notice the comment, thanks for the reference. This is exactly the piece I was missing the whole time. It is for `git rebase -i` to just work, _without_ the additional argument of a branch name. Somehow I didn't realize this at first, even though, as you mentioned, it _is_ hinted at in the original commit message.

> As mentioned in [#854 (comment)](https://github.com/rpm-software-management/rpm/pull/854#issuecomment-1209089265), can't we just do `git checkout --track -b rpm-build` rather than all this explicit branch dance? As in, revert [8b9da98](https://github.com/rpm-software-management/rpm/commit/8b9da98e4c9e256c7c6ecca7f1e5bdbbce29e5da) and then:
> 
> ```
> -%{__git} branch rpm-build \
> -%{__git} checkout rpm-build \
> -%{__git} branch --set-upstream-to=master
> +%{__git} checkout --track -b rpm-build
> ```
> 
> It seems to me this accomplishes the same without having to refer to any explicit branch-names, other than our own. Or am I missing something?

Nice! This is less verbose and fixes the problem at the same time, excerpt from the `git-branch` man page:

```
-t, --track[=(direct|inherit)]
[...]
    The exact upstream branch is chosen depending on the optional argument: -t, --track, or --track=direct means to use the start point branch itself as the upstream;
``` 

With the intentions of this feature being now clear, let's go down the "fix it" instead of "revert it" route. I'll close this PR and create another one with the fixup.





-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2154#issuecomment-1219386504
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/2154/c1219386504 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20220818/6e90dd45/attachment-0001.html>


More information about the Rpm-maint mailing list