Skip to content

Commit aeb2b55

Browse files
committed
New menu functions ezk.git for internal GIT objects
1 parent 9d43505 commit aeb2b55

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

EasyKey.git/ezk-git-giob.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,22 @@ setActual() {
88
actual=$(git rev-parse --abbrev-ref HEAD 2> /dev/null)
99
}
1010

11+
allBranches() {
12+
find .git/refs/heads -type f -exec sh -c 'echo "File: $1"; cat "$1"' _ {} \;
13+
}
14+
15+
allTags() {
16+
find .git/refs/tags -type f -exec sh -c 'echo "File: $1"; cat "$1"' _ {} \;
17+
}
18+
1119
setActual
1220

1321
menuInit "Git object internals"
1422
submenuHead "Usefull commands "
1523
menuItem b "Current HEAD pointer" "git symbolic-ref HEAD"
16-
menuItem c "Inspect current tree" "git cat-file -p ${actual}^{tree}"
17-
menuItem d "Inspect current commit" "git cat-file -p ${actual}^{commit}"
18-
menuItem e "All branches" "tree .git/refs/heads"
19-
menuItem f "All tags" "git fetch --tags && tree .git/refs/tags"
24+
menuItem c "Inspect current tree object" "git cat-file -p ${actual}^{tree}"
25+
menuItem d "Inspect current commit object" "git cat-file -p ${actual}^{commit}"
26+
menuItem e "All branches" allBranches
27+
menuItem f "All tags" allTags
2028
startMenu "setActual"
2129
noterminate

0 commit comments

Comments
 (0)