Skip to content

Commit

Permalink
Improve upstream_diff
Browse files Browse the repository at this point in the history
  • Loading branch information
citrus-it committed Feb 12, 2018
1 parent 8908b8d commit cdff87f
Showing 1 changed file with 8 additions and 50 deletions.
58 changes: 8 additions & 50 deletions bin/omni
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,6 @@ update_illumos()
fi
}

diff_colour()
{
gegrep --colour '^|^ [^ ].*'
}

upstream_diff()
{
typeset arg="$1"
Expand All @@ -248,58 +243,21 @@ upstream_diff()

echo "GATE:"
echo

git log --reverse --no-merges --abbrev-commit \
master..upstream_gate \
| nawk '
function op() {
if (commit)
printf("%-69s %s\n", issue, commit)
commit = 0
}
/^commit / { op(); commit = $2 }
/^ (backout: *|Revert ")?[0-9][0-9][0-9][0-9] / {
gsub(/ +/, " ")
issue = substr($0, 0, 69)
}
END { op() }
' | diff_colour
--pretty="tformat: %C(red bold)%<(67,trunc)%s %C(cyan)%h" \
master..upstream_gate

hash="`joyent_commit`"
head="`git rev-parse upstream_joyent`"
echo
echo "JOYENT ($hash..):"
echo
git log --reverse --no-merges --abbrev-commit \
--grep='^OS-' \
--pretty="tformat: %C(red bold)%<(67,trunc)%s %C(cyan)%h" \
"$hash..$head"

reset_illumos_branch
git checkout -q upstream_joyent
git whatchanged --reverse --no-merges --abbrev-commit \
"$hash.." | nawk -v "opt=$arg" '
function op() {
if (matched)
{
printf("%-69s %s\n", issue, commit)
for (i in files)
print " ", files[i]
print ""
matched = 0
}
# Clear array
split("", files)
}
/^commit / { op(); commit = $2 }
/OS-[0-9]/ {
gsub(/ +/, " ")
issue = substr($0, 0, 69)
}
/^:/ {
files[NR] = sprintf("%s %s", $5, $6)
}
opt == "all" { matched = 1 }
/ lx / { matched = 1 }
/(brand|fs)\/lx/ { matched = 1 }
/\/lx_/ { matched = 1 }
END { op() }
' | diff_colour
git checkout -q "$branch"
echo
)
}
Expand Down

0 comments on commit cdff87f

Please sign in to comment.