]>
Tony Duckles's Git Repositories (git.nynim.org) - dotfiles.git/blob - bin/git-ls-object-refs
2 # Usage: git-ls-object-refs <object>
3 # Find references to <object> SHA1 in refs, commits, and trees. All of them.
10 # git show-ref |grep "$o"
13 git log
--all --pretty=oneline
--decorate |grep "$o" |
14 sed 's|^\([0-9a-f]\{40\}\)|commit referenced from at least one ref: \1|'
16 for ref
in $(git for-each-ref --format='%(refname)')
18 (git rev-list "$ref" | grep "$o") 2>&1 |
19 sed "s|^[0-9a-f]\{40\}$|commit referenced from $ref|"
22 for p in $(git rev-list --all)
24 (git ls-tree -r "$p" |grep "$o") 2>&1 |
25 sed "s|^|object referenced from tree of commit $p:\n|"