From: Jonas Fonseca <fonseca@diku.dk>
To: Petr Baudis <pasky@ucw.cz>, git@vger.kernel.org
Subject: [PATCH] cg-status: handle subdirs when listing heads
Date: Sun, 11 Dec 2005 20:49:26 +0100 [thread overview]
Message-ID: <20051211194926.GG2960@diku.dk> (raw)
In-Reply-To: <20051211190305.GD2960@diku.dk>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---
And here's one which handles empty directories and is cleaner.
diff --git a/cg-status b/cg-status
index a4c5e7a..bd4d0ce 100755
--- a/cg-status
+++ b/cg-status
@@ -123,9 +123,9 @@ if [ "$gitstatus" ]; then
fi
echo "Heads:"
- for head in $_git/refs/heads/*; do
+ find "$_git/refs/heads" ! -type d | sort | while read head; do
headsha1=$(cat "$head")
- headname=$(basename "$head")
+ headname=${head#$_git/refs/heads/}
[ "$headname" = "cg-seek-point" ] && continue
cf=" "; rf=" "
[ "$headname" = "$_git_head" ] && cf=">"
--
Jonas Fonseca
prev parent reply other threads:[~2005-12-11 19:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-11 19:03 [PATCH] cg-status: handle subdirs when listing heads Jonas Fonseca
2005-12-11 19:49 ` Jonas Fonseca [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051211194926.GG2960@diku.dk \
--to=fonseca@diku.dk \
--cc=git@vger.kernel.org \
--cc=pasky@ucw.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).