online.git: engine/bin

0 views
Skip to first unread message

"Stephan Bergmann (via cogerrit)"

unread,
Apr 24, 2026, 4:28:48 AM (5 days ago) Apr 24
to collaboraon...@googlegroups.com
engine/bin/engine-git.sh | 61 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 61 insertions(+)

New commits:
commit 9d42eb554c580c34015709c4dfffe61b96597040
Author: Stephan Bergmann <stephan....@collabora.com>
AuthorDate: Wed Apr 22 12:46:17 2026 +0200
Commit: Noel Grandin <noel.g...@collabora.com>
CommitDate: Fri Apr 24 08:27:55 2026 +0000

Helper script to replay git commands across the engine subtree merge

See the comment at the top of engine/bin/engine-git.sh for details

Signed-off-by: Stephan Bergmann <stephan....@collabora.com>
Change-Id: Ic3501afba7be004c3e846098e99843eac1ebd7d3
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1378
Tested-by: Jenkins CPCI <rel...@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.g...@collabora.com>

diff --git a/engine/bin/engine-git.sh b/engine/bin/engine-git.sh
new file mode 100755
index 000000000000..f876938fdcc3
--- /dev/null
+++ b/engine/bin/engine-git.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+
+# Replay a git history-editing subcommand (cherry-pick, revert, ...) from the old core history onto
+# the subtree-merged online repo, rewriting all paths under engine/.
+#
+# The subcommand and its arguments are passed through to git unchanged, so flags like `cherry-pick
+# -x` or `revert -m 1` work without this wrapper knowing about them. The command runs in a
+# throwaway detached worktree based at merge-engine^2 (the old core tip at the time of the subtree
+# merge), so operations on old-core SHAs succeed there. The resulting commit(s) are then
+# format-patched, path-rewritten, and applied onto the current HEAD with git am.
+#
+# Usage: engine-git.sh <git-subcommand> [args...]
+# e.g. engine-git.sh cherry-pick 301320d53467
+# engine-git.sh cherry-pick -x 301320d53467
+# engine-git.sh revert 301320d53467
+
+set -euo pipefail
+
+if [ $# -lt 1 ]; then
+ printf "usage: %s <git-subcommand> [args...]\n" "$(basename "$0")" >&2
+ exit 1
+fi
+
+base=merge-engine^2
+
+tmp=$(mktemp -d)
+wt="$tmp/wt"
+cleanup() {
+ git worktree remove --force "$wt" >/dev/null 2>&1 || true
+ rm -rf "$tmp"
+}
+trap cleanup EXIT
+
+git worktree add --detach "$wt" "$base" >/dev/null
+
+pre=$(git -C "$wt" rev-parse HEAD)
+git -C "$wt" "$@"
+post=$(git -C "$wt" rev-parse HEAD)
+
+if [ "$pre" = "$post" ]; then
+ printf "%s produced no commits\n" "$1" >&2
+ exit 1
+fi
+
+git -C "$wt" format-patch -k --stdout "$pre..$post" \
+ | awk '
+ /^---$/ { in_diff = 1 }
+ in_diff {
+ if (/^diff --git a\/.* b\//) {
+ sub(/^diff --git a\//, "diff --git a/engine/")
+ sub(/ b\//, " b/engine/")
+ } else if (/^--- a\//) { sub(/^--- a\//, "--- a/engine/") }
+ else if (/^\+\+\+ b\//) { sub(/^\+\+\+ b\//, "+++ b/engine/") }
+ else if (/^rename from /) { sub(/^rename from /, "rename from engine/") }
+ else if (/^rename to /) { sub(/^rename to /, "rename to engine/") }
+ else if (/^copy from /) { sub(/^copy from /, "copy from engine/") }
+ else if (/^copy to /) { sub(/^copy to /, "copy to engine/") }
+ }
+ { print }
+ ' \
+ | git am -k

"Caolán McNamara (via cogerrit)"

unread,
Apr 24, 2026, 7:43:41 AM (5 days ago) Apr 24
to collaboraon...@googlegroups.com
engine/bin/engine-git-log.sh | 14 ++++++++++++++
1 file changed, 14 insertions(+)

New commits:
commit 1c69728ee27ace1683eef37aaab82c3a5b491f3c
Author: Caolán McNamara <caolan....@collabora.com>
AuthorDate: Fri Apr 24 09:03:23 2026 +0000
Commit: Andras Timar <andras...@collabora.com>
CommitDate: Fri Apr 24 11:43:06 2026 +0000

add something to get git log through the 'discontinuity'

e.g. ./engine/bin/engine-git-log.sh engine/download.lst

Signed-off-by: Caolán McNamara <caolan....@collabora.com>
Change-Id: Ic541025ecd28bf2ee2218ed7ce0e97b939c7f23a
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1489
Tested-by: Jenkins CPCI <rel...@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.g...@collabora.com>

diff --git a/engine/bin/engine-git-log.sh b/engine/bin/engine-git-log.sh
new file mode 100755
index 000000000000..a9b4273c5971
--- /dev/null
+++ b/engine/bin/engine-git-log.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+# Show the full log for a file across the engine/ subtree merge.
+# Usage: engine-git-log.sh <path>
+# Path may be given relative to the current directory or from the
+# repo root, with or without the engine/ prefix.
+prefix=$(git rev-parse --show-prefix) || exit 1
+cd "$(git rev-parse --show-toplevel)" || exit 1
+new=${prefix}$1
+old=${new#engine/}
+if [ -t 1 ]; then pager=$(git var GIT_PAGER); else pager=cat; fi
+{
+ git -P log --follow merge-engine..HEAD -- "$new"
+ git -P log --follow merge-engine^2 -- "$old"
+} | $pager

"Stephan Bergmann (via cogerrit)"

unread,
Apr 27, 2026, 8:41:30 AM (2 days ago) Apr 27
to collaboraon...@googlegroups.com
engine/bin/engine-git-log.sh | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)

New commits:
commit e3892fc67200d9cffaa4bfa148045c53bf09a2ca
Author: Stephan Bergmann <stephan....@collabora.com>
AuthorDate: Mon Apr 27 13:21:48 2026 +0200
Commit: Caolán McNamara <caolan....@collabora.com>
CommitDate: Mon Apr 27 12:40:59 2026 +0000

Extend engine/bin/engine-git-log.sh to support optional git-log arguments

Signed-off-by: Stephan Bergmann <stephan....@collabora.com>
Change-Id: I98f63f55a33e2ae5eb23866a42879b4efb51d768
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1725
Reviewed-by: Caolán McNamara <caolan....@collabora.com>
Tested-by: Caolán McNamara <caolan....@collabora.com>

diff --git a/engine/bin/engine-git-log.sh b/engine/bin/engine-git-log.sh
index a9b4273c5971..d895f16cd317 100755
--- a/engine/bin/engine-git-log.sh
+++ b/engine/bin/engine-git-log.sh
@@ -1,14 +1,30 @@
#!/bin/sh
# Show the full log for a file across the engine/ subtree merge.
-# Usage: engine-git-log.sh <path>
+# Usage: engine-git-log.sh [git log args...] <path>
# Path may be given relative to the current directory or from the
-# repo root, with or without the engine/ prefix.
+# repo root, with or without the engine/ prefix. Any preceding
+# arguments are forwarded to git log (e.g. -Sfoo).
+if [ $# -lt 1 ]; then
+ echo "Usage: $0 [git log args...] <path>" >&2
+ exit 1
+fi
prefix=$(git rev-parse --show-prefix) || exit 1
cd "$(git rev-parse --show-toplevel)" || exit 1
-new=${prefix}$1
+n=$#
+i=0
+for arg do
+ i=$((i+1))
+ if [ $i -eq $n ]; then
+ path=$arg
+ else
+ set -- "$@" "$arg"
+ fi
+ shift
+done
+new=${prefix}$path
old=${new#engine/}
if [ -t 1 ]; then pager=$(git var GIT_PAGER); else pager=cat; fi
{
- git -P log --follow merge-engine..HEAD -- "$new"
- git -P log --follow merge-engine^2 -- "$old"
+ git -P log "$@" --follow merge-engine..HEAD -- "$new"
+ git -P log "$@" --follow merge-engine^2 -- "$old"
} | $pager

"Stephan Bergmann (via cogerrit)"

unread,
3:29 AM (3 hours ago) 3:29 AM
to collaboraon...@googlegroups.com
engine/bin/engine-git-log.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit bcf89c13a52f9bb87b3cf9cac7b3b093c8fe4378
Author: Stephan Bergmann <stephan....@collabora.com>
AuthorDate: Wed Apr 29 07:59:13 2026 +0200
Commit: Caolán McNamara <caolan....@collabora.com>
CommitDate: Wed Apr 29 07:29:03 2026 +0000

Make the manual paging behave more like built-in git -p

...by setting the same env vars as documented in the git-config(1) core.pager
section

Signed-off-by: Stephan Bergmann <stephan....@collabora.com>
Change-Id: I0077b40cc15a7507172f5f49c8ca12670e3807ee
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/1789
Tested-by: Jenkins CPCI <rel...@collaboraoffice.com>
Reviewed-by: Caolán McNamara <caolan....@collabora.com>

diff --git a/engine/bin/engine-git-log.sh b/engine/bin/engine-git-log.sh
index d895f16cd317..019786105615 100755
--- a/engine/bin/engine-git-log.sh
+++ b/engine/bin/engine-git-log.sh
@@ -27,4 +27,4 @@ if [ -t 1 ]; then pager=$(git var GIT_PAGER); else pager=cat; fi
{
git -P log "$@" --follow merge-engine..HEAD -- "$new"
git -P log "$@" --follow merge-engine^2 -- "$old"
-} | $pager
+} | LESS=${LESS-FRX} LV=${LV--c} $pager

Reply all
Reply to author
Forward
0 new messages