Hi Gabriel,
On Mon, 20 Jul 2026 at 11:01, Gabriel Wicki <[email protected]> wrote:
> - I checkout some PR (through agit).
[...]
> I guess this comes from the fact that checking out an old PR changes
> mod-times on many files?
Yes.
> How do others deal with this?
Well, on my side, from the master checkout, I fetch the PR:
git fetch -u origin +refs/pull/1234/head:foo/bar
Then I also cherry-pick.
Cherry-pick? Ahah the good ol’ way to apply patches. ;-) Except that
before I even did not type the PR number and just press a key from my
email reader. Heh! Now, it’s just much more steps on my side and I
laugh when I realize how much my cognitive overload has jumped: so much
higher. And yet another non-convivial tools, maybe? Whatever.
Using Magit: Y select foo/bar select master
And apply pick: A +s A. (sign and sign-off).
And time to time, I do something similar as Andreas’s alias, adding the
steps fetch and delete:
fad = "!f() { git fetch -u origin +refs/pull/$1/head:pull/pr/$1 \
&& for id in $(git cherry HEAD pull/pr/$1 | cut -c2-); \
do git cherry-pick --signoff $id; done \
&& git branch -D pull/pr/$1 ;}; f"
Moreover, instead of ’git fetch pulls’, I run ’git prs-fetch’ with this alias:
prs-fetch = "!f() { for pr in
\
$(wget -qO -
'https://codeberg.org/api/v1/repos/guix/guix/pulls?state=open' \
| jq '.[] | .number');
\
do echo Fetching: $pr;
\
git fetch -f -u origin pull/$pr/head:pull/$pr/head ;done
\
}; echo Fetch open PRs; f"
It’s imperfect because it’s not all the open PRs… Well, it’s on my TODO
list to explore the Codeberg API. For example, I have an alias for the
open PRs tagged as with the label team-core:
prs-core = "!f() { for pr in
\
$(curl -s -X 'GET'
\
'https://codeberg.org/api/v1/repos/guix/guix/pulls?state=open&labels=423030' \
-H 'accept: application/json'
\
| jq '.[] | .number');
\
do echo Fetching: $pr;
\
git fetch -f -u origin pull/$pr/head:pull/$pr/head ;done
\
}; echo Fetch core open PRs; f"
And I’m still thinking how I could smooth or reduce the various steps
and/or cognitive overload I have.
Somehow, the PR workflow is to exploit this API:
https://codeberg.org/api/swagger
then ends to apply patches the good ol’ way via cherry-pick. ;-)
The difference with emails workflow? Mainly: just less sober and more
resource consuming, I guess. ;-)
Cheers,
simon