Handle symbolic refs in post-receive-email #1

Closed
opened 2021-07-01 11:15:52 -07:00 by strk · 1 comment

When symbolic refs are in use (like master == main) commit email do not contain the diffs anymore.

I think the culprit is in the show_new_revisions function of the post-receive-email script, which tries to find which revisions are not accessible in other refs (while not skipping the symbolic refs)

It's in this snippet:

        other_branches=$(git for-each-ref --format='%(refname)' refs/heads/ |
            grep -F -v $refname)
        git rev-parse --not $other_branches |
        if [ -z "$custom_showrev" ]
        then
                git rev-list --pretty --stdin $revspec
        else
                git rev-list --stdin $revspec |
                while read onerev
                do
                        eval $(printf "$custom_showrev" $onerev)
                done
        fi

This could maybe be fixed by massaging the output of for-each-ref to rename symbolic refs to their proper name...

Affected projects:

Note that the GEOS project fixed this by dropping the symbolic ref

When symbolic refs are in use (like master == main) commit email do not contain the diffs anymore. I think the culprit is in the `show_new_revisions` function of the `post-receive-email` script, which tries to find which revisions are not accessible in other refs (while not skipping the symbolic refs) It's in this snippet: ``` other_branches=$(git for-each-ref --format='%(refname)' refs/heads/ | grep -F -v $refname) git rev-parse --not $other_branches | if [ -z "$custom_showrev" ] then git rev-list --pretty --stdin $revspec else git rev-list --stdin $revspec | while read onerev do eval $(printf "$custom_showrev" $onerev) done fi ``` This could maybe be fixed by massaging the output of `for-each-ref` to rename symbolic refs to their proper name... Affected projects: - Postgis - https://trac.osgeo.org/postgis/ticket/4937 - GEOS - https://trac.osgeo.org/geos/ticket/1120 Note that the GEOS project fixed this by dropping the symbolic ref
strk closed this issue 2021-07-01 11:28:11 -07:00
Poster
Owner
Confirmed it works again: https://lists.osgeo.org/pipermail/postgis-tickets/2021-July/023868.html
Sign in to join this conversation.
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sac/git-hookscripts#1
There is no content yet.