[bug#76503,GCD] Migrating repositories, issues, and patches to Codeberg

Message ID 87ikn196qg.fsf@gmail.com
State New
Headers
Series [bug#76503,GCD] Migrating repositories, issues, and patches to Codeberg |

Commit Message

Simon Tournier April 18, 2025, 9:08 a.m. UTC
  Hi Ludo,

Ah, I forgot: I would remove the mention to your usual login civodul and
instead use classical aubrey or blake or carol or dana or … :-)

On Thu, 17 Apr 2025 at 21:48, Ludovic Courtès <ludo@gnu.org> wrote:

>> Last, it appears to me a good idea to also provide the tip for removing
>> closed pull requests; because it’s not straightforward – at least, it
>> was not obvious for me before I did my homework. :-)
>
> That’s the ‘prs-clean’ alias you provided, right?

Yes.  To me, it was not obvious how to delete a local reference and
clean my local repository.

Somehow, I’m thinking to the future myself in some months or in 2 years:

I read the GCD for fun and profit and see oh cool, nice tip!  Let run
“git fetch pulls”… and bang it downloads hundreds (or thousand?) of pull
requests containing thousands of commits.  Oops!  Now I need to clean
because I do not care about the hundreds of already merged pull
requests.

> We can add it, but maybe it’s best to keep it for some developer
> documentation?  (I did not intend this part of the GCD to be
> documentation; rather my goal was to give an overview of the available
> interfaces.)

I agree.  All the tips are only appetizers (make us want to cook) and
not some real meal (make us full).

My point reads:

 1) The document provide a “lengthy“ example of fj.el.  And we are not
    all Emacs users.    

 2) The tip ’git fetch pulls’ is almost useless for a regular reviewer.
    I mean in practice, it’s almost useless or bazooka.  Who care to
    download all the pull requests?  Download even all the closed ones,
    and then manually trigger or look for the ones of interest.

 3) This tip ’git fetch pulls’ does not expose Forgejo API.

That’s why, IMHO, the tip ’git fetch pulls’ should be replaced either by
a plain paragraphs, or either by some short and minimal examples exposing
how to exploit the API, or either by a mix of both.

All in all, I propose this:
And the part ’git update-ref -d refs/pullreqs/123’ let as an
exercise. ;-) As said, it’s appetizer and not a complete documentation.


> -However the author thinks that, as it stands, Guix system administrators
> +However, at the moment, Guix system administrators
>  have more than enough on their plate and are perhaps not up to the task
>  of providing the availability guarantees we expect from such a service.
> +Whether to self-host is something that could be revisited in the future.

LGTM.

Cheers,
simon
  

Comments

Ludovic Courtès April 18, 2025, 12:09 p.m. UTC | #1
Hello,

Simon Tournier <zimon.toutoune@gmail.com> writes:

> Ah, I forgot: I would remove the mention to your usual login civodul and
> instead use classical aubrey or blake or carol or dana or … :-)

Good point.

> All in all, I propose this:

I adapted a slightly modified variant of this (using ‘jq’ for parsing)
with slightly modified text.

Thanks,
Ludo’.
  
Simon Tournier April 18, 2025, 1:34 p.m. UTC | #2
Re,

On Fri, 18 Apr 2025 at 14:09, Ludovic Courtès <ludo@gnu.org> wrote:

> I adapted a slightly modified variant of this (using ‘jq’ for parsing)
> with slightly modified text.

LGTM.  Thanks.

Re-reading all, the sections « User Interfaces » and « Continuous
Integration » capture well all the potential of the switch for a better
scaling, IMHO.  Release of the cross-fingers to make it happen. :-)

Well, I have various annoyances (and concerns) but I’m sure these are
opportunities for a better.  Again, I express my support.

Cheers,
simon
  

Patch

diff --git a/002-codeberg.md b/002-codeberg.md
index f931354..4a63c9f 100644
--- a/002-codeberg.md
+++ b/002-codeberg.md
@@ -348,13 +348,28 @@  As a reviewer, it is possible to pull references of pending pull
 requests by adding something like this to `.git/config`:
 
 ```
-[remote "pulls"]
-	   url = git@codeberg.org:org/guix-science/guix-science.git
-	   fetch = +refs/pull/*/head:refs/remotes/pulls/pr/*
+[alias]
+        prs-fetch="!f() { for pr in                                                              \
+        $(curl -s 'https://codeberg.org/api/v1/repos/guix-science/guix-science/pulls?state=open' \
+           | sed 's/,/\\n/g' | grep number | cut -f2 -d':' | sed 's/,//g');                      \
+        do echo Fetch: $pr;                                                                      \
+           git fetch -f -u origin pull/$pr/head:pull/$pr/head ;done                              \
+        }; echo Fetch open PRs; f"
 ```
 
-Running `git fetch pulls` then retrieves references to branches
-corresponding to all the pull requests.
+Running `git prs-fetch` then retrieves references to branches
+corresponding to the pending pull requests.
+
+In addition, one may fetch the list of [closed pull requests as
+JSON](https://codeberg.org/api/v1/repos/guix-science/guix-science/pulls?state=closed),
+extract the number of a pull request of interest, and clean just this
+pull request with:
+
+```
+git update-ref -d refs/heads/pull/123/head
+```
+
+… where `123` is the pull request number.
 
 ## Teams