bitfab 0.62.6 → 0.62.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/bitfab/replay.rb +8 -14
- data/lib/bitfab/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0e4a1e837039a5679b239d2c976e5a0ed657b2270c317a9101ded3416acc48fa
|
|
4
|
+
data.tar.gz: c9168929101f6b1bea5c853a80384a242d64f69dec8c99fb3b4a202ae62bd7b8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3474b103e94a7cce451ab5955652836bf84c0300c3719ece113a14b0114ee41ff322314da45f4d9015b7040672fa84439ba3bc268712c6fab7f58af3f3cda026
|
|
7
|
+
data.tar.gz: 442acb8bb6b2a72154c40ae99ec3d34a55d0d212eaba2e27f60bebd000d8453b7dbc0e683c872d9bbf9689e016866c90f3afb2d312ff846020f1d886b5d85565
|
data/lib/bitfab/replay.rb
CHANGED
|
@@ -562,7 +562,6 @@ module Bitfab
|
|
|
562
562
|
# via BITFAB_CODE_CHANGE_PATH. Returns [description, files] or nil.
|
|
563
563
|
# Best-effort: any error (no env var, missing file, bad JSON) yields nil so
|
|
564
564
|
# the replay proceeds with no code change rather than raising.
|
|
565
|
-
TRUNK_CANDIDATES = ["origin/HEAD", "origin/main", "origin/master", "main", "master"].freeze
|
|
566
565
|
CC_MAX_FILES = 60
|
|
567
566
|
CC_MAX_FILE_BYTES = 500_000
|
|
568
567
|
CC_MAX_TOTAL_BYTES = 2_000_000
|
|
@@ -618,7 +617,8 @@ module Bitfab
|
|
|
618
617
|
# Auto-capture the code change to attach when the caller passed none. Lives
|
|
619
618
|
# in replay() (the one call guaranteed to run on every replay) so it works no
|
|
620
619
|
# matter how the replay was launched. Precedence: a BITFAB_CODE_CHANGE_PATH
|
|
621
|
-
# override, else the git diff
|
|
620
|
+
# override, else the git diff of the working tree vs HEAD (or vs the
|
|
621
|
+
# merge-base with BITFAB_CODE_CHANGE_BASE). Best-effort: any failure yields nil.
|
|
622
622
|
# An explicit code_change_files always wins over this.
|
|
623
623
|
def resolve_auto_code_change(label = nil)
|
|
624
624
|
return nil if ENV["BITFAB_DISABLE_CODE_CHANGE_CAPTURE"]
|
|
@@ -657,23 +657,18 @@ module Bitfab
|
|
|
657
657
|
!git(root, ["rev-parse", "--verify", "#{ref}^{object}"]).nil?
|
|
658
658
|
end
|
|
659
659
|
|
|
660
|
-
# Returns [base,
|
|
660
|
+
# Returns [base, against]. HEAD by default, so only uncommitted edits show;
|
|
661
|
+
# BITFAB_CODE_CHANGE_BASE moves the base to the merge-base with that ref.
|
|
661
662
|
def cc_resolve_base(root)
|
|
662
663
|
forced = ENV["BITFAB_CODE_CHANGE_BASE"]
|
|
663
664
|
if forced && cc_ref_exists?(root, forced)
|
|
664
665
|
mb = git(root, ["merge-base", "HEAD", forced])
|
|
665
|
-
return [mb.strip,
|
|
666
|
+
return [mb.strip, "vs #{forced}"] if mb && !mb.strip.empty?
|
|
666
667
|
|
|
667
668
|
rp = git(root, ["rev-parse", "--verify", forced])
|
|
668
|
-
return (rp && !rp.strip.empty?) ? [rp.strip,
|
|
669
|
+
return (rp && !rp.strip.empty?) ? [rp.strip, "vs #{forced}"] : nil
|
|
669
670
|
end
|
|
670
|
-
|
|
671
|
-
next unless cc_ref_exists?(root, candidate)
|
|
672
|
-
|
|
673
|
-
mb = git(root, ["merge-base", "HEAD", candidate])
|
|
674
|
-
return [mb.strip, true] if mb && !mb.strip.empty?
|
|
675
|
-
end
|
|
676
|
-
cc_ref_exists?(root, "HEAD") ? ["HEAD", false] : nil
|
|
671
|
+
cc_ref_exists?(root, "HEAD") ? ["HEAD", "uncommitted (vs HEAD)"] : nil
|
|
677
672
|
end
|
|
678
673
|
|
|
679
674
|
def cc_blob_bytes(root, base, path)
|
|
@@ -697,7 +692,7 @@ module Bitfab
|
|
|
697
692
|
resolved = cc_resolve_base(root)
|
|
698
693
|
return nil if resolved.nil?
|
|
699
694
|
|
|
700
|
-
base,
|
|
695
|
+
base, against = resolved
|
|
701
696
|
|
|
702
697
|
tracked = git(root, ["diff", "--name-status", "--find-renames", "-z", base, "--", ":!.bitfab"]) || ""
|
|
703
698
|
untracked = git(root, ["ls-files", "--others", "--exclude-standard", "-z", "--", ":!.bitfab"]) || ""
|
|
@@ -737,7 +732,6 @@ module Bitfab
|
|
|
737
732
|
subject = subject ? subject.strip : ""
|
|
738
733
|
head = ((label && !label.strip.empty?) ? label.strip : nil) || (subject.empty? ? nil : subject) || "Working-tree change"
|
|
739
734
|
word = (files.length == 1) ? "file" : "files"
|
|
740
|
-
against = from_trunk ? "vs trunk" : "uncommitted (vs HEAD)"
|
|
741
735
|
["#{head} (#{files.length} #{word} changed #{against})", files]
|
|
742
736
|
rescue
|
|
743
737
|
nil
|
data/lib/bitfab/version.rb
CHANGED