From 21aab1e99801f72d65b644824fad69eb85a87c98 Mon Sep 17 00:00:00 2001 From: kyle Date: Thu, 1 May 2025 03:51:27 +0000 Subject: [PATCH] Added a comment: re: finding key in specific branches --- ..._865ddb8dcfdfc9ed8f2898816be8fbb1._comment | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 doc/forum/whereused__58___--key_other_branches_w__47__o_checkout/comment_1_865ddb8dcfdfc9ed8f2898816be8fbb1._comment diff --git a/doc/forum/whereused__58___--key_other_branches_w__47__o_checkout/comment_1_865ddb8dcfdfc9ed8f2898816be8fbb1._comment b/doc/forum/whereused__58___--key_other_branches_w__47__o_checkout/comment_1_865ddb8dcfdfc9ed8f2898816be8fbb1._comment new file mode 100644 index 0000000000..f58608a5e7 --- /dev/null +++ b/doc/forum/whereused__58___--key_other_branches_w__47__o_checkout/comment_1_865ddb8dcfdfc9ed8f2898816be8fbb1._comment @@ -0,0 +1,34 @@ +[[!comment format=mdwn + username="kyle" + avatar="http://cdn.libravatar.org/avatar/7d6e85cde1422ad60607c87fa87c63f3" + subject="re: finding key in specific branches" + date="2025-05-01T03:51:27Z" + content=""" +> get git-annex whereused --key to act on one or more other branches +> than the checked-out one + +The `--historical` flag of `whereused` leads to a wider search, +including of other branches but also other things, like the current +branch's history and the reflog. + +I'm guessing you're after more specific control. + +If I want to know when a key occurred in a particular branch, I +usually do something like + +``` +$ git log -p -S $KEY $BRANCH +``` + +To know whether a particular key is in the *tip* of a particular +branch (or of some subset of branches), one way would be + +``` +$ git rev-list --objects --no-object-names --no-walk $BRANCH | \ + git annex lookupkey --ref --batch | \ + grep $KEY +``` + +Perhaps there are more streamlined ways to get to that information, +though. +"""]]