git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git-request-get ?

From
Matěj Cepl <mcepl@cepl.eu>
Date
Jan 15, 2024, 16:24 UTC
Message-ID
<CYFF4ELXFAXS.3RLW2GBX2DZFN@cepl.eu>
Hello,

I am still haunted by my own ancient comment on https://gitlab.com/gitlab-org/gitlab/-/issues/14116:

Show 8 quoted lines
> Well, the minimal solution [to federated merge requests]
> would be a parser for the git-request-pull(1), which would
> check every comment and if recognized the comment as the
> pull request, it would add button for the owner of the repo
> (e.g., [Create Pull Request]). After pressing that (so it is
> constantly under the control of the owner repo), gitlab would
> setup new remote (if doesn't exist still), fetch it, and create
> a merge request.

Of course, the part with a button has to be resolved in a particular web application, but I am still wondering whether there isn’t any way how to make consuming git-request-pull(1) generated emails more easily digestable and thus promote the use of the tool.

First I created rather complicated bash script (https://da.gd/pSgdc), but then I have read CodingGuidelines and found that I need to keep myself to the POSIX shell script, so I have simplified a lot. Besides, I don’t think the complicated part (like adding remotes) is necessarily a good thing (???). Currently I have just this:

    #!/bin/sh
    set -eu
    STR="$(cat)"
    URL="$(echo "$STR" | sed -n -e '/^are available in the Git repository at:/,+2 {
    s/[[:space:]]\+//
    s/\(=[[:digit:]]\{2\}\)\+$//
    /^\(http\|git\)/p
    }')"
    END="$(echo "$STR" | awk '/^for you to fetch changes up to / { print $NF }' | sed -e 's/[=:]*$//')"
    git fetch "$URL" "$END"
    git checkout -B _4review FETCH_HEAD

Do you think this is a good idea at all? Should we be more complicated or less? Should we do some fun things like parsing and adding remotes, parsing email addresses or something to create individualized branch names for review? Stuff like that.

Looking forward to any feedback.
Best,
Matěj
-- 
http://matej.ceplovi.cz/blog/, @mcepl@floss.social
GPG Finger: 3C76 A027 CA45 AD70 98B5  BC1D 7920 5802 880B C9D8
 
Those to whom evil is done \ Do evil in return.
    -- W. H. Auden, September 1, 1939
       http://www.poets.org/viewmedia.php/prmMID/15545
Message 1 of 1 in “git-request-get ?”
  1. Matěj CeplJan 15, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.