{"thread":{"id":"4465","subject":"[PATCH 1/3] cg-admin-rewritehist: catch git-rev-list returning no commit","startedAt":"2006-06-11T12:04:55Z","lastAt":"2006-06-17T23:21:43Z","messageCount":4,"participants":["Yann Dirson","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"21590","messageId":"20060611120455.12116.14042.stgit@gandelf.nowhere.earth","threadId":"4465","inReplyTo":"20060611120431.12116.74005.stgit@gandelf.nowhere.earth","subject":"[PATCH 1/3] cg-admin-rewritehist: catch git-rev-list returning no commit","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2006-06-11T12:04:55Z","receivedAt":"2006-06-11T12:04:55Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"\n\n\nSigned-off-by: Yann Dirson <ydirson@altern.org>\n---\n\n cg-admin-rewritehist |    4 ++++\n 1 files changed, 4 insertions(+), 0 deletions(-)\n\ndiff --git a/cg-admin-rewritehist b/cg-admin-rewritehist\nindex 861c7f6..fe3f210 100755\n--- a/cg-admin-rewritehist\n+++ b/cg-admin-rewritehist\n@@ -199,6 +199,10 @@ done\n git-rev-list --topo-order HEAD $startrev | tac >../revs\n commits=$(cat ../revs | wc -l)\n \n+if [ $commits -eq 0 ]; then\n+    die \"Found nothing to rewrite\"\n+fi\n+\n i=0\n while read commit; do\n \ti=$((i+1))\n"},{"id":"21591","messageId":"20060611120457.12116.81253.stgit@gandelf.nowhere.earth","threadId":"4465","inReplyTo":"20060611120431.12116.74005.stgit@gandelf.nowhere.earth","subject":"[PATCH 2/3] cg-admin-rewritehist: catch errors in -r argument early","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2006-06-11T12:04:57Z","receivedAt":"2006-06-11T12:04:57Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"\n\n\nSigned-off-by: Yann Dirson <ydirson@altern.org>\n---\n\n cg-admin-rewritehist |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/cg-admin-rewritehist b/cg-admin-rewritehist\nindex fe3f210..7cbdb30 100755\n--- a/cg-admin-rewritehist\n+++ b/cg-admin-rewritehist\n@@ -154,6 +154,8 @@ while optparse; do\n \tif optparse -d=; then\n \t\ttempdir=\"$OPTARG\"\n \telif optparse -r=; then\n+\t\tgit-rev-parse \"$OPTARG\" >/dev/null || die \"Unknown revision '$OPTARG'\"\n+\t\tgit-rev-parse \"$OPTARG^\" >/dev/null || die \"Revision '$OPTARG' does not have parents, check what you really want\"\n \t\tstartrev=\"^$OPTARG^ $OPTARG $startrev\"\n \t\tstartrevparents=\"$OPTARG $startrevparents\"\n \telif optparse --env-filter=; then\n"},{"id":"21592","messageId":"20060611120459.12116.87606.stgit@gandelf.nowhere.earth","threadId":"4465","inReplyTo":"20060611120431.12116.74005.stgit@gandelf.nowhere.earth","subject":"[PATCH 3/3] cg-admin-rewritehist: seed the map with the parent of the -r arg, not with itself","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2006-06-11T12:05:00Z","receivedAt":"2006-06-11T12:05:00Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"\nThis is a fix for 95621e54cedef1c4a270af5570a72fc1331b5fcb.\n\nSigned-off-by: Yann Dirson <ydirson@altern.org>\n---\n\n cg-admin-rewritehist |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/cg-admin-rewritehist b/cg-admin-rewritehist\nindex 7cbdb30..6dd8b92 100755\n--- a/cg-admin-rewritehist\n+++ b/cg-admin-rewritehist\n@@ -157,7 +157,7 @@ while optparse; do\n \t\tgit-rev-parse \"$OPTARG\" >/dev/null || die \"Unknown revision '$OPTARG'\"\n \t\tgit-rev-parse \"$OPTARG^\" >/dev/null || die \"Revision '$OPTARG' does not have parents, check what you really want\"\n \t\tstartrev=\"^$OPTARG^ $OPTARG $startrev\"\n-\t\tstartrevparents=\"$OPTARG $startrevparents\"\n+\t\tstartrevparents=\"$OPTARG^ $startrevparents\"\n \telif optparse --env-filter=; then\n \t\tfilter_env=\"$OPTARG\"\n \telif optparse --tree-filter=; then\n"},{"id":"21979","messageId":"20060617232143.GN11941@pasky.or.cz","threadId":"4465","inReplyTo":"20060611120459.12116.87606.stgit@gandelf.nowhere.earth","subject":"Re: [PATCH 1/3] cg-admin-rewritehist: catch git-rev-list returning no commit","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2006-06-17T23:21:43Z","receivedAt":"2006-06-17T23:21:43Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Sun, Jun 11, 2006 at 02:04:55PM CEST, I got a letter\nwhere Yann Dirson <ydirson@altern.org> said that...\n> Signed-off-by: Yann Dirson <ydirson@altern.org>\n> ---\n> \n>  cg-admin-rewritehist |    4 ++++\n>  1 files changed, 4 insertions(+), 0 deletions(-)\n> \n> diff --git a/cg-admin-rewritehist b/cg-admin-rewritehist\n> index 861c7f6..fe3f210 100755\n> --- a/cg-admin-rewritehist\n> +++ b/cg-admin-rewritehist\n> @@ -199,6 +199,10 @@ done\n>  git-rev-list --topo-order HEAD $startrev | tac >../revs\n>  commits=$(cat ../revs | wc -l)\n>  \n> +if [ $commits -eq 0 ]; then\n> +    die \"Found nothing to rewrite\"\n> +fi\n> +\n>  i=0\n>  while read commit; do\n>  \ti=$((i+1))\n\nThanks, applied.\n\nDear diary, on Sun, Jun 11, 2006 at 02:04:57PM CEST, I got a letter\nwhere Yann Dirson <ydirson@altern.org> said that...\n> Signed-off-by: Yann Dirson <ydirson@altern.org>\n> ---\n> \n>  cg-admin-rewritehist |    2 ++\n>  1 files changed, 2 insertions(+), 0 deletions(-)\n> \n> diff --git a/cg-admin-rewritehist b/cg-admin-rewritehist\n> index fe3f210..7cbdb30 100755\n> --- a/cg-admin-rewritehist\n> +++ b/cg-admin-rewritehist\n> @@ -154,6 +154,8 @@ while optparse; do\n>  \tif optparse -d=; then\n>  \t\ttempdir=\"$OPTARG\"\n>  \telif optparse -r=; then\n> +\t\tgit-rev-parse \"$OPTARG\" >/dev/null || die \"Unknown revision '$OPTARG'\"\n> +\t\tgit-rev-parse \"$OPTARG^\" >/dev/null || die \"Revision '$OPTARG' does not have parents, check what you really want\"\n>  \t\tstartrev=\"^$OPTARG^ $OPTARG $startrev\"\n>  \t\tstartrevparents=\"$OPTARG $startrevparents\"\n>  \telif optparse --env-filter=; then\n\nThanks, I've adapted it to the current codebase.\n\nDear diary, on Sun, Jun 11, 2006 at 02:05:00PM CEST, I got a letter\nwhere Yann Dirson <ydirson@altern.org> said that...\n> This is a fix for 95621e54cedef1c4a270af5570a72fc1331b5fcb.\n> \n> Signed-off-by: Yann Dirson <ydirson@altern.org>\n> ---\n> \n>  cg-admin-rewritehist |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n> \n> diff --git a/cg-admin-rewritehist b/cg-admin-rewritehist\n> index 7cbdb30..6dd8b92 100755\n> --- a/cg-admin-rewritehist\n> +++ b/cg-admin-rewritehist\n> @@ -157,7 +157,7 @@ while optparse; do\n>  \t\tgit-rev-parse \"$OPTARG\" >/dev/null || die \"Unknown revision '$OPTARG'\"\n>  \t\tgit-rev-parse \"$OPTARG^\" >/dev/null || die \"Revision '$OPTARG' does not have parents, check what you really want\"\n>  \t\tstartrev=\"^$OPTARG^ $OPTARG $startrev\"\n> -\t\tstartrevparents=\"$OPTARG $startrevparents\"\n> +\t\tstartrevparents=\"$OPTARG^ $startrevparents\"\n>  \telif optparse --env-filter=; then\n>  \t\tfilter_env=\"$OPTARG\"\n>  \telif optparse --tree-filter=; then\n\nThanks; I've already applied a patch similar in spirit from someone\nelse.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nA person is just about as big as the things that make them angry.\n"}]}