{"thread":{"id":"60746","subject":"git-request-get ?","startedAt":"2024-01-15T16:31:08Z","lastAt":"2024-01-15T16:31:08Z","messageCount":1,"participants":["Matěj Cepl"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"486812","messageId":"CYFF4ELXFAXS.3RLW2GBX2DZFN@cepl.eu","threadId":"60746","inReplyTo":null,"subject":"git-request-get ?","fromName":"Matěj Cepl","fromEmail":"mcepl@cepl.eu","sentAt":"2024-01-15T16:24:54Z","receivedAt":"2024-01-15T16:31:08Z","isPatch":false,"sender":{"key":"mcepl@cepl.eu","avatar":"https://avatars.githubusercontent.com/u/198999?v=4"},"body":"Hello,\n\nI am still haunted by my own ancient comment on\nhttps://gitlab.com/gitlab-org/gitlab/-/issues/14116:\n\n> Well, the minimal solution [to federated merge requests]\n> would be a parser for the git-request-pull(1), which would\n> check every comment and if recognized the comment as the\n> pull request, it would add button for the owner of the repo\n> (e.g., [Create Pull Request]). After pressing that (so it is\n> constantly under the control of the owner repo), gitlab would\n> setup new remote (if doesn't exist still), fetch it, and create\n> a merge request.\n\nOf course, the part with a button has to be resolved in a\nparticular web application, but I am still wondering whether\nthere isn’t any way how to make consuming git-request-pull(1)\ngenerated emails more easily digestable and thus promote the use\nof the tool.\n\nFirst I created rather complicated bash script\n(https://da.gd/pSgdc), but then I have read CodingGuidelines and\nfound that I need to keep myself to the POSIX shell script, so\nI have simplified a lot. Besides, I don’t think the complicated\npart (like adding remotes) is necessarily a good thing (???).\nCurrently I have just this:\n\n    #!/bin/sh\n    set -eu\n\n    STR=\"$(cat)\"\n\n    URL=\"$(echo \"$STR\" | sed -n -e '/^are available in the Git repository at:/,+2 {\n    s/[[:space:]]\\+//\n    s/\\(=[[:digit:]]\\{2\\}\\)\\+$//\n    /^\\(http\\|git\\)/p\n    }')\"\n\n    END=\"$(echo \"$STR\" | awk '/^for you to fetch changes up to / { print $NF }' | sed -e 's/[=:]*$//')\"\n    git fetch \"$URL\" \"$END\"\n    git checkout -B _4review FETCH_HEAD\n\nDo you think this is a good idea at all? Should we be more\ncomplicated or less? Should we do some fun things like parsing\nand adding remotes, parsing email addresses or something to\ncreate individualized branch names for review? Stuff like that.\n\nLooking forward to any feedback.\n\nBest,\n\nMatěj\n\n-- \nhttp://matej.ceplovi.cz/blog/, @mcepl@floss.social\nGPG Finger: 3C76 A027 CA45 AD70 98B5  BC1D 7920 5802 880B C9D8\n \nThose to whom evil is done \\ Do evil in return.\n    -- W. H. Auden, September 1, 1939\n       http://www.poets.org/viewmedia.php/prmMID/15545\n\n"}]}