{"thread":{"id":"23513","subject":"[PATCH] rebase-interactive: silence warning when no commits rewritten","startedAt":"2010-04-18T12:01:45Z","lastAt":"2010-04-18T18:42:59Z","messageCount":2,"participants":["Jeff King","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"139820","messageId":"20100418120145.GA14872@coredump.intra.peff.net","threadId":"23513","inReplyTo":null,"subject":"[PATCH] rebase-interactive: silence warning when no commits rewritten","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-04-18T12:01:45Z","receivedAt":"2010-04-18T12:01:45Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"If you do a \"rebase -i\" and don't change any commits,\nnothing is rewritten, and we have no REWRITTEN_LIST. The\nshell prints out an ugly message:\n\n  $ GIT_EDITOR=true git rebase -i HEAD^\n  /path/to/git-rebase--interactive: 1: cannot open\n    /path/to/repo/.git/rebase-merge/rewritten-list: No such file\n  Successfully rebased and updated refs/heads/master.\n\nWe can fix it by not running \"notes copy\" at all if nothing\nwas rewritten.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nWe already use the same test just below when deciding whether to run the\npost-rewrite hook.\n\n git-rebase--interactive.sh |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex b817c4a..436b7f5 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -562,12 +562,13 @@ do_next () {\n \t\t;;\n \tesac && {\n \t\ttest ! -f \"$DOTEST\"/verbose ||\n \t\t\tgit diff-tree --stat $(cat \"$DOTEST\"/head)..HEAD\n \t} &&\n \t{\n+\t\ttest -s \"$REWRITTEN_LIST\" &&\n \t\tgit notes copy --for-rewrite=rebase < \"$REWRITTEN_LIST\" ||\n \t\ttrue # we don't care if this copying failed\n \t} &&\n \tif test -x \"$GIT_DIR\"/hooks/post-rewrite &&\n \t\ttest -s \"$REWRITTEN_LIST\"; then\n \t\t\"$GIT_DIR\"/hooks/post-rewrite rebase < \"$REWRITTEN_LIST\"\n-- \n1.7.1.rc1.279.gae4efc.dirty\n"},{"id":"139834","messageId":"7vfx2swqj0.fsf@alter.siamese.dyndns.org","threadId":"23513","inReplyTo":"20100418120145.GA14872@coredump.intra.peff.net","subject":"Re: [PATCH] rebase-interactive: silence warning when no commits rewritten","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-04-18T18:42:59Z","receivedAt":"2010-04-18T18:42:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks; I stumbled upon this the other day and was annoyed myself.\n"}]}