Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

umpf: omit hash/version info on show without --identical #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ tests = [
'umpf-format-patch',
'umpf-format-patch-bb',
'umpf-show',
'umpf-show-identical',
'umpf-versions'
]
foreach test_name : tests
Expand Down
10 changes: 10 additions & 0 deletions tests/series-identical-v1.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# umpf-base: base
# umpf-name: name
# umpf-version: name/20221209-1
# umpf-topic: a
# umpf-hashinfo: f46ed0419d2c31ed10f978cc461e0d1ae4b3b426
# umpf-topic-range: d306da785d874c09b89264d3f71632bc14bfe51f..b2b9f854952b0be84ba2472f236783d09bfa6561
# umpf-topic: b
# umpf-hashinfo: 3755a03cf640725df1aeb13789cba87154a47b04
# umpf-topic-range: b2b9f854952b0be84ba2472f236783d09bfa6561..e791a2bb22e021b8513809e1e1cbf692be74fd99
# umpf-end
5 changes: 0 additions & 5 deletions tests/series-v1.ref
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# umpf-base: base
# umpf-name: name
# umpf-version: name/20221209-1
# umpf-topic: a
# umpf-hashinfo: f46ed0419d2c31ed10f978cc461e0d1ae4b3b426
# umpf-topic-range: d306da785d874c09b89264d3f71632bc14bfe51f..b2b9f854952b0be84ba2472f236783d09bfa6561
# umpf-topic: b
# umpf-hashinfo: 3755a03cf640725df1aeb13789cba87154a47b04
# umpf-topic-range: b2b9f854952b0be84ba2472f236783d09bfa6561..e791a2bb22e021b8513809e1e1cbf692be74fd99
# umpf-end
2 changes: 1 addition & 1 deletion tests/umpf-merge
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
umpf merge a
umpf merge b

umpf show --base=base --name=name > series.merge
umpf show --identical --base=base --name=name > series.merge

diff -u ${TEST_DIR}/series-merge.ref series.merge
2 changes: 1 addition & 1 deletion tests/umpf-merge-build
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
git checkout umpf-merge
umpf build --remote=origin --base=base --name=name

umpf show > series.build
umpf show --identical > series.build
diff -u ${TEST_DIR}/series-merge.ref series.build
2 changes: 1 addition & 1 deletion tests/umpf-series-build
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ git ls-tree umpf-build > ls-tree.ref
git ls-tree HEAD > ls-tree.build
diff -u ls-tree.ref ls-tree.build

umpf show HEAD > series.build
umpf show --identical HEAD > series.build
diff -u ${TEST_DIR}/series-merge.ref series.build
2 changes: 1 addition & 1 deletion tests/umpf-series-tag-continue-flags
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sed -i '/^# umpf-base: base$/a # umpf-flags: extraversion=conflictfree' series.c
umpf tag -f --version=2 series.conflict --remote=origin || test $? = 1
git add a.txt
echo | umpf continue
umpf show 2>&1
umpf show --identical 2>&1

diff -u ${TEST_DIR}/version-files/ref/Makefile.conflictfree Makefile
git log --format=%B -n 1 | grep "^# umpf-" > series.tag
Expand Down
8 changes: 8 additions & 0 deletions tests/umpf-show-identical
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
#
# Test the output of "umpf show".
#

umpf show --identical umpf-tag > series.show

diff -u ${TEST_DIR}/series-identical-v1.ref series.show
8 changes: 7 additions & 1 deletion umpf
Original file line number Diff line number Diff line change
Expand Up @@ -1877,7 +1877,13 @@ do_abort() {

do_show() {
VERBOSE=true
prepare_persistent show "${@}"
prepare_persistent show "${@}" | (
if $IDENTICAL; then
cat
else
sed -r '/^# umpf-(version|topic-range|hashinfo|release): /d'
fi
)
cleanup
}

Expand Down