You are not logged in.

#1 2023-12-09 11:02:53

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

git command to apply a pending PR to foo-git [SOLVED]

When building a git package (ie foo-git) where the source is the git repo, what is the git command to pull a pending PR, for example PR#1234?  In the past, add this to the prepare function did it:

git pull --no-edit --rebase origin pull/1234/head

But now I get:

==> Starting prepare()...
From /srcdest/xbmc
 * branch                    refs/pull/24199/head -> FETCH_HEAD
Committer identity unknown

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'builduser@arch-nspawn-2584336.(none)')

I can add the following to the prepare function, but this seems like too much work:

  git config user.email "you@example.com"
  git config user.name "Your Name"
  git pull --no-edit --rebase origin pull/1234/head

Last edited by graysky (2023-12-09 18:55:28)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2023-12-09 12:32:50

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: git command to apply a pending PR to foo-git [SOLVED]

I think you should use `git reset` instead of `git pull`. A pull implies a merge, hence the ID request.

https://stackoverflow.com/questions/430 … gin-branch

Offline

#3 2023-12-09 12:43:33

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Re: git command to apply a pending PR to foo-git [SOLVED]

What is the proper syntax to use git reset to apply a PR?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#4 2023-12-09 12:45:10

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: git command to apply a pending PR to foo-git [SOLVED]

Not sure smile

Try

git reset --hard $commit

Replace $commit with the actual commit, ofc.

Offline

#5 2023-12-09 14:16:48

merlock
Member
Registered: 2018-10-30
Posts: 236

Re: git command to apply a pending PR to foo-git [SOLVED]

Maybe something here might help?


Eenie meenie, chili beanie, the spirits are about to speak -- Bullwinkle J. Moose
It's a big club...and you ain't in it -- George Carlin
Registered Linux user #149839
perl -e 'print$i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10); '

Offline

#6 2023-12-09 15:19:30

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,958

Re: git command to apply a pending PR to foo-git [SOLVED]

I prefer not using git/svn/bzr etc commands, but adding commit urls to the source array, then using patch to apply them.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#7 2023-12-09 16:43:15

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Re: git command to apply a pending PR to foo-git [SOLVED]

@Lone_Wolf - problem here is that PR I need to apply contains binary diffs which are not supported by patch.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#8 2023-12-09 18:25:31

loqs
Member
Registered: 2014-03-06
Posts: 17,417

Re: git command to apply a pending PR to foo-git [SOLVED]

graysky wrote:

@Lone_Wolf - problem here is that PR I need to apply contains binary diffs which are not supported by patch.

Use git apply in place of patch?

Offline

#9 2023-12-09 18:55:12

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Re: git command to apply a pending PR to foo-git [SOLVED]

loqs wrote:
graysky wrote:

@Lone_Wolf - problem here is that PR I need to apply contains binary diffs which are not supported by patch.

Use git apply in place of patch?

Yes!  That did the trick, thanks!


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

Board footer

Powered by FluxBB