{"thread":{"id":"1109","subject":"Proposed script: cg-info","startedAt":"2005-07-05T05:46:12Z","lastAt":"2005-07-05T09:22:28Z","messageCount":2,"participants":["Pavel Roskin","Petr Baudis"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"5658","messageId":"1120542372.17286.7.camel@dv","threadId":"1109","inReplyTo":null,"subject":"Proposed script: cg-info","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2005-07-05T05:46:12Z","receivedAt":"2005-07-05T05:46:12Z","isPatch":false,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Hello!\n\nIt would be useful to have a script to display current status of the\nrepository - branches, current branch and merge status.  Maybe I'm\nmissing something, but I don't see such script.\n\nI wrote a script that would do that.  I'm still not fully familiar with\nthe concepts of cogito, so maybe wrong terms are used in the script.  I\njust want to offer this scripts as a base for further work.\n\ncg-info sounds very pretentious, so maybe the script should be renamed\nto cg-heads-ls or cg-admin-status or something like that.\n\nSigned-off-by: Pavel Roskin <proski@gnu.org>\n\n#!/usr/bin/env bash\n#\n# Show status of the GIT repository.\n# Copyright (c) Pavel Roskin 2005\n#\n# The output includes the list of branches and merge status.\n# Current branch is marked by \">\"\n\nUSAGE=\"cg-info\"\n\n. ${COGITO_LIB}cg-Xlib\n\nmkdir -p $_git/refs/heads\n[ \"$(find $_git/refs/heads -follow -type f)\" ] \\\n       || die \"List of heads is empty.\"\n\nbranch=\nheadlink=$(readlink $_git/HEAD)\nif [ \"$headlink\" ]; then\n\tbranch=$(basename \"$headlink\")\nelse\n\theadsha1=$(cat $_git/HEAD)\n\techo \"HEAD: $headsha1\"\nfi\n\necho \"Heads:\"\n\nfor head in $_git/refs/heads/*; do\n\theadsha1=$(cat $head)\n\theadbase=$(basename $head)\n\tif [ \"$headbase\" = \"$branch\" ]; then\n\t\techo \">$headbase $headsha1\"\n\telse\n\t\techo \" $headbase $headsha1\"\n\tfi\ndone\n\nif [ -s \"$_git/blocked\" ]; then\n\ttmp=$(cat \"$_git/blocked\")\n\techo \"Blocked: $tmp\"\nfi\n\nif [ -s \"$_git/merging\" ]; then\n\ttmp=$(cat \"$_git/merging\")\n\techo \"Merging: $tmp\"\nfi\n\nif [ -s \"$_git/merging-sym\" ]; then\n\ttmp=$(cat \"$_git/merging-sym\")\n\techo \"Merging-sym: $tmp\"\nfi\n\nif [ -s \"$_git/merge-base\" ]; then\n\ttmp=$(cat \"$_git/merge-base\")\n\techo \"Merge-base: $tmp\"\nfi\n\n\n-- \nRegards,\nPavel Roskin\n"},{"id":"5662","messageId":"20050705092228.GC6191@pasky.ji.cz","threadId":"1109","inReplyTo":"1120542372.17286.7.camel@dv","subject":"Re: Proposed script: cg-info","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2005-07-05T09:22:28Z","receivedAt":"2005-07-05T09:22:28Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Tue, Jul 05, 2005 at 07:46:12AM CEST, I got a letter\nwhere Pavel Roskin <proski@gnu.org> told me that...\n> Hello!\n\nHello,\n\n> It would be useful to have a script to display current status of the\n> repository - branches, current branch and merge status.  Maybe I'm\n> missing something, but I don't see such script.\n> \n> I wrote a script that would do that.  I'm still not fully familiar with\n> the concepts of cogito, so maybe wrong terms are used in the script.  I\n> just want to offer this scripts as a base for further work.\n> \n> cg-info sounds very pretentious, so maybe the script should be renamed\n> to cg-heads-ls or cg-admin-status or something like that.\n> \n> Signed-off-by: Pavel Roskin <proski@gnu.org>\n\nthanks. I've somewhat cleaned it up and added some more information to\nshow, and committed it.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\n<Espy> be careful, some twit might quote you out of context..\n"}]}