[aur-general] PKGBUILD git remote branch issue

Eli Schwartz eschwartz at archlinux.org
Wed Nov 7 14:57:42 UTC 2018


On 11/7/18 9:38 AM, Ralf Mardorf wrote:
> On Wed, 2018-11-07 at 08:38 -0500, Eli Schwartz via aur-general wrote:
>> As per the PKGBUILD(5) man page, use:
>>
>> source=("git://example.com/reponame.git#FOO=BAR")
>>
>> where FOO is either:
>> - tag
>> - branch
>> - commit
>>
>> and BAR is the corresponding revision you wish to check out (in this
>> case the branch name is "gtk3")
>>
>> So, #FOO=BAR would be #branch=gtk3
> 
> Thank you,
> 
> unfortunately it doesn't work.
> 
> [rocketmouse at archlinux claws-mail-gtk3-git]$ ls
> PKGBUILD
> [rocketmouse at archlinux claws-mail-gtk3-git]$ makepkg -s
> ==> Making package: claws-mail-gtk3-git 3.17.0-1 (Wed 07 Nov 2018 03:27:22 PM CET)
> [snip]
> ==> Starting prepare()...
> ==> Starting pkgver()...
> ==> Updated version: claws-mail-gtk3-git 3.16.0.r463.g04185a6e4-1
> ==> Starting build()...
> ^C
> 
> [rocketmouse at archlinux tmp]$ git clone git://git.claws-mail.org/claws.git
> [snip]
> [rocketmouse at archlinux tmp]$ cd claws/
> [rocketmouse at archlinux claws]$ git fetch origin
> [rocketmouse at archlinux claws]$ git branch --track gtk3 origin/gtk3
> Branch 'gtk3' set up to track remote branch 'gtk3' from 'origin'.
> [rocketmouse at archlinux claws]$ ./autogen.sh
> [snip]
> claws-mail 3.17.0git153
> [snip]

That output is entirely correct.

When you use my command, you checkout "gtk3" during the clone.

When you use your command, you create a gtk3 branch that you never use,
because you stayed on master. If you'd switched to the gtk3 branch you
created, using "git checkout gtk3", you'd see that it tells you
"Switched to branch 'gtk3'"

...

This is why I recommended you use a proper git clone in the first place.

...

Other fun tricks:

$ git clone git://git.claws-mail.org/claws.git
Cloning into 'claws'...
[...]
$ git checkout gtk3
Branch 'gtk3' set up to track remote branch 'gtk3' from 'origin'.
Switched to a new branch 'gtk3'


No need to do crazy stuff with manual branching either -- git is super
smart and knows what you mean. It also tells you when it's doing it, so
you can verify that it happened.

-- 
Eli Schwartz
Bug Wrangler and Trusted User

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.archlinux.org/pipermail/aur-general/attachments/20181107/6ce63041/attachment.asc>


More information about the aur-general mailing list