{"thread":{"id":"43334","subject":"Re: [PATCH] Improve git-prune -n output","startedAt":"2006-11-02T11:12:26Z","lastAt":"2006-11-03T02:40:32Z","messageCount":2,"participants":["Junio C Hamano","Andy Parkins"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"294462","messageId":"200611021112.26420.andyparkins@gmail.com","threadId":"43334","inReplyTo":null,"subject":"[PATCH] Improve git-prune -n output","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2006-11-02T11:12:26Z","receivedAt":"2006-11-02T11:12:26Z","isPatch":true,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"prune_object() in show_only mode would previously just show the path to the\nobject that would be deleted.  The path the object is stored in shouldn't be\nshown to users, they only know about sha1 identifiers so show that instead.\n\nFurther, the sha1 alone isn't that useful for examining what is going to be\ndeleted.  This patch also adds the object type to the output, which makes it\neasy to pick out, say, the commits and use git-show to display them.\n\nSigned-off-by: Andy Parkins <andyparkins@gmail.com>\n---\n builtin-prune.c |    8 +++++++-\n 1 files changed, 7 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin-prune.c b/builtin-prune.c\nindex d853902..286a94c 100644\n--- a/builtin-prune.c\n+++ b/builtin-prune.c\n@@ -16,8 +16,14 @@ static struct rev_info revs;\n \n static int prune_object(char *path, const char *filename, const unsigned char *sha1)\n {\n+\tchar buf[20];\n+\tconst char *type;\n+\n \tif (show_only) {\n-\t\tprintf(\"would prune %s/%s\\n\", path, filename);\n+\t\ttype = buf;\n+\t\tif (sha1_object_info(sha1, type, NULL))\n+\t\t\ttype = \"unknown\";\n+\t\tprintf(\"%s %s\\n\", sha1_to_hex(sha1), type );\n \t\treturn 0;\n \t}\n \tunlink(mkpath(\"%s/%s\", path, filename));\n-- \n1.4.3.2\n"},{"id":"294390","messageId":"7vslh1l0bj.fsf@assigned-by-dhcp.cox.net","threadId":"43334","inReplyTo":"200611021112.26420.andyparkins@gmail.com","subject":"Re: [PATCH] Improve git-prune -n output","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-11-03T02:40:32Z","receivedAt":"2006-11-03T02:40:32Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andy Parkins <andyparkins@gmail.com> writes:\n\n> prune_object() in show_only mode would previously just show the path to the\n> object that would be deleted.  The path the object is stored in shouldn't be\n> shown to users, they only know about sha1 identifiers so show that instead.\n>\n> Further, the sha1 alone isn't that useful for examining what is going to be\n> deleted.  This patch also adds the object type to the output, which makes it\n> easy to pick out, say, the commits and use git-show to display them.\n>\n> Signed-off-by: Andy Parkins <andyparkins@gmail.com>\n\nList members and git users, \n\n\tif you are using \"prune -n\" output in your scripts, this\nchange could cause those scripts to break; so please holler.\n\nI am inclined to take this output format change, so if you are\ngoing to holler please do so fast.\n"}]}