{"thread":{"id":"6550","subject":"reflog for HEAD (detached or between branches)","startedAt":"2007-01-26T22:25:13Z","lastAt":"2007-01-27T01:49:10Z","messageCount":4,"participants":["Nicolas Pitre","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"32767","messageId":"11698503133039-git-send-email-nico@cam.org","threadId":"6550","inReplyTo":null,"subject":"reflog for HEAD (detached or between branches)","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2007-01-26T22:25:13Z","receivedAt":"2007-01-26T22:25:13Z","isPatch":false,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"\nThis is the implementation for the idea I proposed for the support of\nreflog with detached head.  In fact with this serie HEAD has a reflog\nof its own which may or may not contain the same log entries found in\nreflogs of individual branches.\n\nNicolas\n"},{"id":"32780","messageId":"7vbqkluzcm.fsf@assigned-by-dhcp.cox.net","threadId":"6550","inReplyTo":"11698503133039-git-send-email-nico@cam.org","subject":"Re: reflog for HEAD (detached or between branches)","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-26T23:45:13Z","receivedAt":"2007-01-26T23:45:13Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I suspect that \"git-reflog --expire\", \"git-fsck-objects\" and\n\"git-prune\" need to be updated to take the reflog associated\nwith the HEAD into account, as for_each_ref() does not call you\nwith HEAD.\n\nOther than that, I think the series is beautifully done.\n\nThanks.\n"},{"id":"32791","messageId":"7v64ats0m3.fsf@assigned-by-dhcp.cox.net","threadId":"6550","inReplyTo":"7vbqkluzcm.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH 1/3] create_symref: check error return from open().","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-27T01:46:12Z","receivedAt":"2007-01-27T01:46:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\n * There seem to be similarly \"casual\" users of open in the rest\n   of the code, but I noticed this while looking at your series.\n   I've already done the necessary shuffling in my tree, so\n   there is no need to resend your \"move create_symref()\".\n\n refs.c |    6 +++++-\n 1 files changed, 5 insertions(+), 1 deletions(-)\n\ndiff --git a/refs.c b/refs.c\nindex 0840b3b..12e46b8 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -331,7 +331,11 @@ int create_symref(const char *ref_target, const char *refs_heads_master)\n \t\treturn -1;\n \t}\n \tlockpath = mkpath(\"%s.lock\", git_HEAD);\n-\tfd = open(lockpath, O_CREAT | O_EXCL | O_WRONLY, 0666);\t\n+\tfd = open(lockpath, O_CREAT | O_EXCL | O_WRONLY, 0666);\n+\tif (fd < 0) {\n+\t\terror(\"Unable to open %s for writing\", lockpath);\n+\t\treturn -5;\n+\t}\n \twritten = write_in_full(fd, ref, len);\n \tclose(fd);\n \tif (written != len) {\n-- \n1.5.0.rc2.g8ac6-dirty\n"},{"id":"32793","messageId":"7vlkjpqlwp.fsf@assigned-by-dhcp.cox.net","threadId":"6550","inReplyTo":"7vbqkluzcm.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH 3/3] write_in_full: size_t is unsigned.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-27T01:49:10Z","receivedAt":"2007-01-27T01:49:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"It received the return value from xwrite() in a size_t variable\n'written' and expected comparison with 0 would catch an error\nfrom xwrite().\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n * and this is the third bug t7207-co.sh caught.  I haven't\n   bothered to look at the assembly, but I suspect the error\n   return path could have been totally optimized out X-<.\n\n write_or_die.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/write_or_die.c b/write_or_die.c\nindex 046e79d..5c4bc85 100644\n--- a/write_or_die.c\n+++ b/write_or_die.c\n@@ -23,7 +23,7 @@ int write_in_full(int fd, const void *buf, size_t count)\n \tssize_t total = 0;\n \n \twhile (count > 0) {\n-\t\tsize_t written = xwrite(fd, p, count);\n+\t\tssize_t written = xwrite(fd, p, count);\n \t\tif (written < 0)\n \t\t\treturn -1;\n \t\tif (!written) {\n-- \n1.5.0.rc2.g8ac6-dirty\n"}]}