Skip to content

virt7 rpm source for systemd --- BEWARE OF FORCE PUSHES (just in case)

Notifications You must be signed in to change notification settings

CentOS-virt7/systemd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

== Adding patches to systemd

optionally checkout original systemd:

$ cd <yourgitrepocollectiondir>
$ git clone git://anongit.freedesktop.org/systemd/systemd
$ cd systemd

add the RHEL-7 repo for systemd

$ git remote add systemd-rhel-7 git+ssh://git.engineering.redhat.com/srv/git/users/harald/systemd-rhel7.git

$ git fetch systemd-rhel-7
...
 * [new branch]      RHEL-7     -> systemd-rhel-7/RHEL-7

$ git checkout RHEL-7
Branch RHEL-7 set up to track remote branch RHEL-7 from systemd-rhel-7.
Switched to a new branch 'RHEL-7'

$ git cherry-pick <some-commit>

ADD THE BUGZILLA NUMBER
$ git commit --amend

$ git push


Now return to the rhpkg systemd git.

$ ./gitpull.sh

This modifies systemd.spec to contain the modifications to systemd-207 as a Patch.


== Working with the backport notes

Checkout a vanilla systemd git, or use your existing checkout
$ git clone git://anongit.freedesktop.org/systemd/systemd
$ cd systemd

Fetch the RHEL-7 systemd git
$ git remote add systemd-rhel-7
git+ssh://git.engineering.redhat.com/srv/git/users/harald/systemd-rhel7.git
$ git fetch systemd-rhel-7

Fetch the RHEL-7 notes
$ git fetch systemd-rhel-7  refs/notes/backport:refs/notes/backport

Display the log with the "backport" notes:
$ git log --notes=backport systemd-rhel-7/RHEL-7

Display a short log with the "backport" notes:
$ for i in $(git rev-list --branches=systemd-rhel-7/* \
  v207..systemd-rhel-7/RHEL-7); do git notes --ref=backport show $i &>/dev/null\
  && git log -1 --format="%H $(git notes --ref=backport show $i): %s" $i|cat ||\
  git log -1 --format="%H: %s" $i ;done


To update the backport notes automatically, use this shell script:
#!/bin/bash

while read s a; do
    # continue, if already tagged
    git notes --ref=backport show $a &>/dev/null && continue

    if [[ "$s" == "+" ]]; then
        git log -1 --format='Maybe not backported: %H %s' $a
        continue
    fi

    backported=0
    while read c; do
        if [[ "$a" == "$c" ]]; then
            echo "FAIL: $a == $c"
            exit 1
        fi
        [[ "$(git show $a | git patch-id | { read a b; echo $a;})" != "$(git
show $c | git patch-id | { read a b; echo $a;})" ]] \
            && continue
        echo "Noting $a and $c"
        git notes --ref=backport add -m "backport of $c" $a
        git notes --ref=backport add -m "backported to RHEL-7" $c
        backported=1
        break
    done < <(git rev-list --branches=origin/* v206..origin/master)

    [[ $backported == 0 ]] && git log -1 --format='Not backported: %H %s' $a

done < <(git cherry origin/master systemd-rhel-7/RHEL-7)


To manually add a note:
$ git notes --ref=backport add -m "message" <commit>

To push the notes:
$ git push systemd-rhel-7  refs/notes/backport

To display a colorful list of which patches are backported:
$ git cherry systemd-rhel-7/RHEL-7 origin/master | \
  while read a b; do if [ "$a" = "+" ] && \
  ! git notes --ref=backport show $b &>/dev/null; then \
  printf "\e[1;31m"; else printf "\e[1;32m";fi; \
  git log -1 --no-color --format=oneline $b; printf "\e[0m";done


[alias]
    cherrycol = "!sh -c 'git cherry \"$@\" | while read a b; do if [ \"$a\" = \"+\" ] && ! git notes --ref=backport show $b &>/dev/null; then printf \"\\e[1;31m\"; else printf \"\\e[1;32m\";fi; git log -1 --no-color --format=oneline $b; printf \"\\e[0m\";done

Of course all in one line...
$ git cherrycol systemd-rhel-7/RHEL-7 origin/master

About

virt7 rpm source for systemd --- BEWARE OF FORCE PUSHES (just in case)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published