mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-05-04 20:06:43 +02:00
community/git-branchless: upgrade to 0.9.0 and add man pages
This commit is contained in:
parent
f370374db2
commit
4a19fafbb4
@ -1,8 +1,8 @@
|
||||
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
|
||||
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
|
||||
pkgname=git-branchless
|
||||
pkgver=0.8.0
|
||||
pkgrel=1
|
||||
pkgver=0.9.0
|
||||
pkgrel=0
|
||||
pkgdesc="Suite of tools to help you visualize, navigate, manipulate, and repair your commit graph"
|
||||
url="https://github.com/arxanas/git-branchless"
|
||||
# riscv64: test fails
|
||||
@ -21,10 +21,9 @@ checkdepends="
|
||||
bash
|
||||
git
|
||||
"
|
||||
subpackages="$pkgname-doc"
|
||||
source="https://github.com/arxanas/git-branchless/archive/v$pkgver/git-branchless-$pkgver.tar.gz
|
||||
unbundle-sqlite.patch
|
||||
fix-git-2.44-auto_merge.patch
|
||||
fix-tests-git-2.42.patch
|
||||
"
|
||||
options="net"
|
||||
|
||||
@ -66,11 +65,10 @@ check() {
|
||||
|
||||
package() {
|
||||
install -D -m755 target/release/git-branchless -t "$pkgdir"/usr/bin/
|
||||
./target/release/git-branchless install-man-pages "$pkgdir"/usr/share/man/
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
ad3435948ffabe256fff2f7b0fe654818fc280049fea0df845ce593ccd713faf5988c843062cfae28c10641c84ed15abaeb0ae774d21e88364f83c0c82852964 git-branchless-0.8.0.tar.gz
|
||||
a6edb671e188bb53cbe43c760c922233ed9e2e7cfdc3d2a32a020dfb847cff413a0c30333d03e76acf920459c438672cd2b975d515b57bfddd1ecc1bbceb1de4 unbundle-sqlite.patch
|
||||
d4a259751283137034b662b29de66203f54caf72be8549e2bde5e65b5c7dc193feb5b3b5f3e9b91d7bda7b2bfab9c4fc28e3f58ee859308835beeb429d527e13 fix-git-2.44-auto_merge.patch
|
||||
055e3f3559b0d5eefc1a43e2fde0cfadff631ec4bf28de720dc7f6ba502687be94748afe63cf5698288d34d843b92b3b7bef174e12f61914e9945d782e9f4eda fix-tests-git-2.42.patch
|
||||
b391360e8e2f08312c3c8a3589a251c248884a329333ffa837dd82bd4e29f47f5bf83100135c222174fb055d7c04c4abc7017a925e37ff61469d8756186b53bf git-branchless-0.9.0.tar.gz
|
||||
dc80e42a3dd95c22c212bf3d440d605842d2f30c52517b1a2de8f62cca5a312ca9939ac9c2e50c1b005fb6b0597810a4f8897062bc1171a22a54df3419b4d384 unbundle-sqlite.patch
|
||||
"
|
||||
|
||||
@ -1,165 +0,0 @@
|
||||
Patch-Source: https://github.com/arxanas/git-branchless/commit/8b1ae8b29f2abf10e5585d48cea4bd85862a529b
|
||||
--
|
||||
From 8b1ae8b29f2abf10e5585d48cea4bd85862a529b Mon Sep 17 00:00:00 2001
|
||||
From: Waleed Khan <me@waleedkhan.name>
|
||||
Date: Sun, 18 Feb 2024 16:36:55 -0800
|
||||
Subject: [PATCH] tests: Try to fix failing `git-next` tests
|
||||
|
||||
---
|
||||
git-branchless-lib/src/core/eventlog.rs | 8 +++++++-
|
||||
git-branchless-lib/src/testing.rs | 7 +++++++
|
||||
git-branchless-lib/tests/test_eventlog.rs | 4 ++++
|
||||
git-branchless/tests/test_bug_report.rs | 2 +-
|
||||
git-branchless/tests/test_eventlog.rs | 2 +-
|
||||
git-branchless/tests/test_hooks.rs | 2 +-
|
||||
git-branchless/tests/test_undo.rs | 8 ++++++--
|
||||
git-branchless/tests/test_wrap.rs | 5 +++--
|
||||
8 files changed, 30 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/git-branchless-lib/src/core/eventlog.rs b/git-branchless-lib/src/core/eventlog.rs
|
||||
index 31fce007d..bcdc214d1 100644
|
||||
--- a/git-branchless-lib/src/core/eventlog.rs
|
||||
+++ b/git-branchless-lib/src/core/eventlog.rs
|
||||
@@ -710,7 +710,13 @@ pub fn should_ignore_ref_updates(reference_name: &ReferenceName) -> bool {
|
||||
|
||||
matches!(
|
||||
reference_name.as_str(),
|
||||
- "ORIG_HEAD" | "CHERRY_PICK" | "REBASE_HEAD" | "CHERRY_PICK_HEAD" | "FETCH_HEAD"
|
||||
+ "ORIG_HEAD"
|
||||
+ | "CHERRY_PICK"
|
||||
+ | "REBASE_HEAD"
|
||||
+ | "CHERRY_PICK_HEAD"
|
||||
+ // From Git's `is_special_ref` in `refs.c`:
|
||||
+ | "AUTO_MERGE"
|
||||
+ | "FETCH_HEAD"
|
||||
)
|
||||
}
|
||||
|
||||
diff --git a/git-branchless-lib/src/testing.rs b/git-branchless-lib/src/testing.rs
|
||||
index 6799bc5f8..d1cea37a6 100644
|
||||
--- a/git-branchless-lib/src/testing.rs
|
||||
+++ b/git-branchless-lib/src/testing.rs
|
||||
@@ -654,6 +654,13 @@ then you can only run tests in the main `git-branchless` and \
|
||||
Ok(version >= GitVersion(2, 27, 0))
|
||||
}
|
||||
|
||||
+ /// Git v2.44 produces `AUTO_MERGE` refs as part of some operations, which
|
||||
+ /// changes the event log according to the `reference-transaction` hook.
|
||||
+ pub fn produces_auto_merge_refs(&self) -> eyre::Result<bool> {
|
||||
+ let version = self.get_version()?;
|
||||
+ Ok(version >= GitVersion(2, 44, 0))
|
||||
+ }
|
||||
+
|
||||
/// Resolve a file during a merge or rebase conflict with the provided
|
||||
/// contents.
|
||||
#[instrument]
|
||||
diff --git a/git-branchless-lib/tests/test_eventlog.rs b/git-branchless-lib/tests/test_eventlog.rs
|
||||
index 461019b70..e69e44fb6 100644
|
||||
--- a/git-branchless-lib/tests/test_eventlog.rs
|
||||
+++ b/git-branchless-lib/tests/test_eventlog.rs
|
||||
@@ -46,6 +46,10 @@ fn test_drop_non_meaningful_events() -> eyre::Result<()> {
|
||||
fn test_different_event_transaction_ids() -> eyre::Result<()> {
|
||||
let git = make_git()?;
|
||||
|
||||
+ if git.produces_auto_merge_refs()? {
|
||||
+ return Ok(());
|
||||
+ }
|
||||
+
|
||||
git.init_repo()?;
|
||||
git.commit_file("test1", 1)?;
|
||||
git.branchless("hide", &["--no-delete-branches", "HEAD"])?;
|
||||
diff --git a/git-branchless/tests/test_bug_report.rs b/git-branchless/tests/test_bug_report.rs
|
||||
index 5788024eb..0cc1596c3 100644
|
||||
--- a/git-branchless/tests/test_bug_report.rs
|
||||
+++ b/git-branchless/tests/test_bug_report.rs
|
||||
@@ -16,7 +16,7 @@ fn redact_timestamp(str: String) -> String {
|
||||
fn test_bug_report() -> eyre::Result<()> {
|
||||
let git = make_git()?;
|
||||
|
||||
- if !git.supports_reference_transactions()? {
|
||||
+ if !git.supports_reference_transactions()? || git.produces_auto_merge_refs()? {
|
||||
return Ok(());
|
||||
}
|
||||
git.init_repo()?;
|
||||
diff --git a/git-branchless/tests/test_eventlog.rs b/git-branchless/tests/test_eventlog.rs
|
||||
index cc2cbf9e6..21b51fd6a 100644
|
||||
--- a/git-branchless/tests/test_eventlog.rs
|
||||
+++ b/git-branchless/tests/test_eventlog.rs
|
||||
@@ -8,7 +8,7 @@ use lib::testing::make_git;
|
||||
fn test_git_v2_31_events() -> eyre::Result<()> {
|
||||
let git = make_git()?;
|
||||
|
||||
- if !git.supports_reference_transactions()? {
|
||||
+ if !git.supports_reference_transactions()? || git.produces_auto_merge_refs()? {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
diff --git a/git-branchless/tests/test_hooks.rs b/git-branchless/tests/test_hooks.rs
|
||||
index 57fc5d4b7..7acb6e278 100644
|
||||
--- a/git-branchless/tests/test_hooks.rs
|
||||
+++ b/git-branchless/tests/test_hooks.rs
|
||||
@@ -222,7 +222,7 @@ fn test_pre_auto_gc() -> eyre::Result<()> {
|
||||
fn test_merge_commit_recorded() -> eyre::Result<()> {
|
||||
let git = make_git()?;
|
||||
|
||||
- if !git.supports_reference_transactions()? {
|
||||
+ if !git.supports_reference_transactions()? || git.produces_auto_merge_refs()? {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
diff --git a/git-branchless/tests/test_undo.rs b/git-branchless/tests/test_undo.rs
|
||||
index 8cd289427..9bf46e7f1 100644
|
||||
--- a/git-branchless/tests/test_undo.rs
|
||||
+++ b/git-branchless/tests/test_undo.rs
|
||||
@@ -136,7 +136,7 @@ fn test_undo_help() -> eyre::Result<()> {
|
||||
fn test_undo_navigate() -> eyre::Result<()> {
|
||||
let git = make_git()?;
|
||||
|
||||
- if !git.supports_reference_transactions()? {
|
||||
+ if !git.supports_reference_transactions()? || git.produces_auto_merge_refs()? {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ fn test_undo_navigate() -> eyre::Result<()> {
|
||||
fn test_go_to_event() -> eyre::Result<()> {
|
||||
let git = make_git()?;
|
||||
|
||||
- if !git.supports_reference_transactions()? {
|
||||
+ if !git.supports_reference_transactions()? || git.produces_auto_merge_refs()? {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
@@ -433,6 +433,10 @@ fn test_undo_move_refs() -> eyre::Result<()> {
|
||||
fn test_historical_smartlog_visibility() -> eyre::Result<()> {
|
||||
let git = make_git()?;
|
||||
|
||||
+ if git.produces_auto_merge_refs()? {
|
||||
+ return Ok(());
|
||||
+ }
|
||||
+
|
||||
git.init_repo()?;
|
||||
git.detach_head()?;
|
||||
git.commit_file("test1", 1)?;
|
||||
diff --git a/git-branchless/tests/test_wrap.rs b/git-branchless/tests/test_wrap.rs
|
||||
index fb78e369a..3223bd18f 100644
|
||||
--- a/git-branchless/tests/test_wrap.rs
|
||||
+++ b/git-branchless/tests/test_wrap.rs
|
||||
@@ -9,7 +9,7 @@ use lib::testing::{make_git, GitRunOptions};
|
||||
fn test_wrap_rebase_in_transaction() -> eyre::Result<()> {
|
||||
let git = make_git()?;
|
||||
|
||||
- if !git.supports_reference_transactions()? {
|
||||
+ if !git.supports_reference_transactions()? || git.produces_auto_merge_refs()? {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
@@ -28,7 +28,8 @@ fn test_wrap_rebase_in_transaction() -> eyre::Result<()> {
|
||||
let event_replayer = EventReplayer::from_event_log_db(&effects, &repo, &event_log_db)?;
|
||||
let events: Vec<Event> = get_event_replayer_events(&event_replayer)
|
||||
.iter()
|
||||
- .map(|event| redact_event_timestamp(event.clone()))
|
||||
+ .cloned()
|
||||
+ .map(redact_event_timestamp)
|
||||
.collect();
|
||||
|
||||
// Bug fixed in Git v2.35: https://github.com/git/git/commit/4866a64508465938b7661eb31afbde305d83e234
|
||||
@ -1,28 +0,0 @@
|
||||
Patch-Source: https://github.com/arxanas/git-branchless/commit/dbbaed74a6dc9a3aa098375845cbfab74b380ae6
|
||||
--
|
||||
From dbbaed74a6dc9a3aa098375845cbfab74b380ae6 Mon Sep 17 00:00:00 2001
|
||||
From: Waleed Khan <me@waleedkhan.name>
|
||||
Date: Sat, 23 Dec 2023 17:44:05 -0600
|
||||
Subject: [PATCH] fix(undo): fix `test_git_bisect_produces_empty_event`
|
||||
|
||||
Broken on the Git `next` branch. Probably broken by https://github.com/git/git/commit/3460e3d6676870713ef17b300b03f70ee8f3cc44 or a commit slightly before that.
|
||||
---
|
||||
git-branchless/tests/test_undo.rs | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/git-branchless/tests/test_undo.rs b/git-branchless/tests/test_undo.rs
|
||||
index 1ee81acca..8cd289427 100644
|
||||
--- a/git-branchless/tests/test_undo.rs
|
||||
+++ b/git-branchless/tests/test_undo.rs
|
||||
@@ -660,6 +660,11 @@ fn test_git_bisect_produces_empty_event() -> eyre::Result<()> {
|
||||
if !git.supports_reference_transactions()? {
|
||||
return Ok(());
|
||||
}
|
||||
+ if git.get_version()? >= GitVersion(2, 42, 0) {
|
||||
+ // Later versions of Git write `BISECT_EXPECTED_REV` to the filesystem
|
||||
+ // as well, causing the below test to fail.
|
||||
+ return Ok(());
|
||||
+ }
|
||||
git.init_repo()?;
|
||||
|
||||
git.commit_file("test1", 1)?;
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/Cargo.lock
|
||||
+++ b/Cargo.lock
|
||||
@@ -2088,7 +2087,6 @@
|
||||
@@ -2091,7 +2091,6 @@
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "afc22eff61b133b115c6e8c74e818c628d6d5e7a502afea6f64dee076dd94326"
|
||||
dependencies = [
|
||||
@ -10,12 +10,12 @@
|
||||
]
|
||||
--- a/Cargo.toml
|
||||
+++ b/Cargo.toml
|
||||
@@ -84,7 +84,7 @@
|
||||
@@ -85,7 +85,7 @@
|
||||
portable-pty = "0.8.1"
|
||||
rayon = "1.7.0"
|
||||
regex = "1.9.3"
|
||||
rayon = "1.10.0"
|
||||
regex = "1.10.4"
|
||||
-rusqlite = { version = "0.29.0", features = ["bundled"] }
|
||||
+rusqlite = { version = "0.29.0" }
|
||||
scm-bisect = { version = "0.1.0", path = "scm-bisect" }
|
||||
scm-record = { version = "0.1.0", path = "scm-record" }
|
||||
serde = { version = "1.0.168", features = ["derive"] }
|
||||
scm-bisect = { version = "0.2.0", path = "scm-bisect" }
|
||||
scm-record = "0.3.0"
|
||||
serde = { version = "1.0.198", features = ["derive"] }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user