Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F174923271
D58161.id181758.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D58161.id181758.diff
View Options
diff --git a/tools/tools/git/git-mfc b/tools/tools/git/git-mfc
--- a/tools/tools/git/git-mfc
+++ b/tools/tools/git/git-mfc
@@ -250,6 +250,31 @@
return origins
+def load_ignore_list(repo):
+ """
+ Load commit hashes from $HOME/.git-mfc-ignore. Each line has the format:
+ <commit-hash> [ignored text]
+ where the hash may be abbreviated. Blank lines and lines starting with
+ '#' are skipped. Each hash is resolved to a full commit to validate it.
+ """
+ path = os.path.join(os.environ['HOME'], '.git-mfc-ignore')
+ commits = set()
+ try:
+ with open(path) as f:
+ for lineno, line in enumerate(f, 1):
+ line = line.strip()
+ if not line or line.startswith('#'):
+ continue
+ abbrev = line.split()[0]
+ try:
+ commits.add(repo.commit(abbrev).hexsha)
+ except (git.exc.BadName, ValueError):
+ err(1, f"{path}:{lineno}: unknown commit {abbrev}")
+ except FileNotFoundError:
+ pass
+ return commits
+
+
def dangling(repo, upstream, author=None, committer=None):
"""
Find commits in the current branch which have been cherry-picked from
@@ -478,13 +503,19 @@
err(1, "could not determine user email; use -c or --all")
if args.dangling:
+ ignored = load_ignore_list(repo)
missing = dangling(repo, upstream, author=author, committer=committer)
for fixup, commit in missing:
+ if fixup.hexsha in ignored:
+ continue
print(f'{commit_summary(fixup)} fixes {commit_summary(commit)}')
elif args.pending:
+ ignored = load_ignore_list(repo)
results = pending(repo, upstream, author=author, committer=committer,
baking=args.baking)
for commit, ready_date, ready in results:
+ if commit.hexsha in ignored:
+ continue
date_str = ready_date.strftime('%Y-%m-%d')
if ready:
status = f"ready since {date_str}"
diff --git a/tools/tools/git/git-mfc.1 b/tools/tools/git/git-mfc.1
--- a/tools/tools/git/git-mfc.1
+++ b/tools/tools/git/git-mfc.1
@@ -287,6 +287,20 @@
.Bd -literal -offset indent
$ git mfc -r freebsd --origin main abc123
.Ed
+.Sh FILES
+.Bl -tag -width "$HOME/.git-mfc-ignore"
+.It Pa $HOME/.git-mfc-ignore
+A list of commits to exclude from
+.Fl -pending
+and
+.Fl -dangling
+output.
+Each line contains a commit hash, optionally abbreviated, followed by
+arbitrary text which is ignored.
+Blank lines and lines beginning with
+.Ql #
+are skipped.
+.El
.Sh SEE ALSO
.Xr git-cherry-pick 1 ,
.Xr git-config 1 ,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Oct 8, 12:13 AM (6 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40308896
Default Alt Text
D58161.id181758.diff (2 KB)
Attached To
Mode
D58161: git-mfc: Add an ignore-list feature
Attached
Detach File
Event Timeline
Log In to Comment