* git-request-get ?
@ 2024-01-15 16:24 Matěj Cepl
0 siblings, 0 replies; only message in thread
From: Matěj Cepl @ 2024-01-15 16:24 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: text/plain, Size: 2166 bytes --]
Hello,
I am still haunted by my own ancient comment on
https://gitlab.com/gitlab-org/gitlab/-/issues/14116:
> 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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 216 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-01-15 16:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-15 16:24 git-request-get ? Matěj Cepl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox