From 75850241d10a7293a9497324fdf020673c08cfa4 Mon Sep 17 00:00:00 2001 From: gegoune <69750637+gegoune@users.noreply.github.com> Date: Tue, 17 Feb 2026 22:24:47 +0200 Subject: [PATCH 1/4] feat: output list of all branches to metadata --- README.md | 2 ++ assets/in | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index ab2637e8..9dcab3dd 100644 --- a/README.md +++ b/README.md @@ -562,6 +562,8 @@ the case. * `.git/branch`: Name of the original branch that was cloned. +* `.git/all_branches`: List of all branches (requires `all_branches` set to `true`). + * `.git/tags`: Comma-separated list of tags associated with this commit. * `.git/author`: Commit author name. diff --git a/assets/in b/assets/in index 7c50dda4..cef59adb 100755 --- a/assets/in +++ b/assets/in @@ -311,6 +311,10 @@ git log -1 --format=%cd --date=${timestamp_format} > .git/commit_timestamp # a custom tag, or package to publish echo "$(git describe ${describe_ref_options})" > .git/describe_ref +if [ "${all_branches,,}" == "true" ]; then + echo $all_branches > .git/all_branches +fi + if [ "$clean_tags" == "true" ]; then git tag | xargs git tag -d From acb7ab5fc25e1eb0230bd954550cb63e3f4adcaf Mon Sep 17 00:00:00 2001 From: gegoune <69750637+gegoune@users.noreply.github.com> Date: Thu, 19 Feb 2026 22:05:38 +0200 Subject: [PATCH 2/4] fixup! feat: output list of all branches to metadata --- README.md | 2 +- assets/in | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9dcab3dd..57a37a67 100644 --- a/README.md +++ b/README.md @@ -562,7 +562,7 @@ the case. * `.git/branch`: Name of the original branch that was cloned. -* `.git/all_branches`: List of all branches (requires `all_branches` set to `true`). +* `.git/branches_list.json`: List of all branches (requires `all_branches` set to `true`). * `.git/tags`: Comma-separated list of tags associated with this commit. diff --git a/assets/in b/assets/in index cef59adb..857ca080 100755 --- a/assets/in +++ b/assets/in @@ -312,7 +312,8 @@ git log -1 --format=%cd --date=${timestamp_format} > .git/commit_timestamp echo "$(git describe ${describe_ref_options})" > .git/describe_ref if [ "${all_branches,,}" == "true" ]; then - echo $all_branches > .git/all_branches + git for-each-ref --format='%(refname:lstrip=3)' refs/remotes/ \ + | jq --raw-input --slurp --compact-output 'split("\n")[:-1]' > .git/branches_list.json fi From 33f4c9c5dd4f6b53de6a4bf9402e3432c269c235 Mon Sep 17 00:00:00 2001 From: gegoune <69750637+gegoune@users.noreply.github.com> Date: Thu, 19 Feb 2026 22:29:15 +0200 Subject: [PATCH 3/4] fix: exclude `HEAD` --- assets/in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/in b/assets/in index 857ca080..667894d2 100755 --- a/assets/in +++ b/assets/in @@ -312,7 +312,7 @@ git log -1 --format=%cd --date=${timestamp_format} > .git/commit_timestamp echo "$(git describe ${describe_ref_options})" > .git/describe_ref if [ "${all_branches,,}" == "true" ]; then - git for-each-ref --format='%(refname:lstrip=3)' refs/remotes/ \ + git for-each-ref --format='%(refname:lstrip=3)' --exclude='refs/remotes/*/HEAD' refs/remotes \ | jq --raw-input --slurp --compact-output 'split("\n")[:-1]' > .git/branches_list.json fi From 3602ac53e02a3adb334a1d79b5284bf866c4b3e6 Mon Sep 17 00:00:00 2001 From: gegoune <69750637+gegoune@users.noreply.github.com> Date: Fri, 20 Feb 2026 19:41:28 +0200 Subject: [PATCH 4/4] fixup! fix: exclude `HEAD` --- assets/in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/in b/assets/in index 667894d2..3f074f27 100755 --- a/assets/in +++ b/assets/in @@ -312,7 +312,7 @@ git log -1 --format=%cd --date=${timestamp_format} > .git/commit_timestamp echo "$(git describe ${describe_ref_options})" > .git/describe_ref if [ "${all_branches,,}" == "true" ]; then - git for-each-ref --format='%(refname:lstrip=3)' --exclude='refs/remotes/*/HEAD' refs/remotes \ + git for-each-ref --format '%(refname:lstrip=3)' --exclude 'refs/remotes/*/HEAD' refs/remotes \ | jq --raw-input --slurp --compact-output 'split("\n")[:-1]' > .git/branches_list.json fi