git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] cg-admin-rewritehist: catch git-rev-list returning no commit
       [not found] <20060611120431.12116.74005.stgit@gandelf.nowhere.earth>
@ 2006-06-11 12:04 ` Yann Dirson
  2006-06-17 23:21   ` Petr Baudis
  2006-06-11 12:04 ` [PATCH 2/3] cg-admin-rewritehist: catch errors in -r argument early Yann Dirson
  2006-06-11 12:05 ` [PATCH 3/3] cg-admin-rewritehist: seed the map with the parent of the -r arg, not with itself Yann Dirson
  2 siblings, 1 reply; 4+ messages in thread
From: Yann Dirson @ 2006-06-11 12:04 UTC (permalink / raw)
  To: Petr Baudis; +Cc: git




Signed-off-by: Yann Dirson <ydirson@altern.org>
---

 cg-admin-rewritehist |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/cg-admin-rewritehist b/cg-admin-rewritehist
index 861c7f6..fe3f210 100755
--- a/cg-admin-rewritehist
+++ b/cg-admin-rewritehist
@@ -199,6 +199,10 @@ done
 git-rev-list --topo-order HEAD $startrev | tac >../revs
 commits=$(cat ../revs | wc -l)
 
+if [ $commits -eq 0 ]; then
+    die "Found nothing to rewrite"
+fi
+
 i=0
 while read commit; do
 	i=$((i+1))

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] cg-admin-rewritehist: catch errors in -r argument early
       [not found] <20060611120431.12116.74005.stgit@gandelf.nowhere.earth>
  2006-06-11 12:04 ` [PATCH 1/3] cg-admin-rewritehist: catch git-rev-list returning no commit Yann Dirson
@ 2006-06-11 12:04 ` Yann Dirson
  2006-06-11 12:05 ` [PATCH 3/3] cg-admin-rewritehist: seed the map with the parent of the -r arg, not with itself Yann Dirson
  2 siblings, 0 replies; 4+ messages in thread
From: Yann Dirson @ 2006-06-11 12:04 UTC (permalink / raw)
  To: Petr Baudis; +Cc: git




Signed-off-by: Yann Dirson <ydirson@altern.org>
---

 cg-admin-rewritehist |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/cg-admin-rewritehist b/cg-admin-rewritehist
index fe3f210..7cbdb30 100755
--- a/cg-admin-rewritehist
+++ b/cg-admin-rewritehist
@@ -154,6 +154,8 @@ while optparse; do
 	if optparse -d=; then
 		tempdir="$OPTARG"
 	elif optparse -r=; then
+		git-rev-parse "$OPTARG" >/dev/null || die "Unknown revision '$OPTARG'"
+		git-rev-parse "$OPTARG^" >/dev/null || die "Revision '$OPTARG' does not have parents, check what you really want"
 		startrev="^$OPTARG^ $OPTARG $startrev"
 		startrevparents="$OPTARG $startrevparents"
 	elif optparse --env-filter=; then

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] cg-admin-rewritehist: seed the map with the parent of the -r arg, not with itself
       [not found] <20060611120431.12116.74005.stgit@gandelf.nowhere.earth>
  2006-06-11 12:04 ` [PATCH 1/3] cg-admin-rewritehist: catch git-rev-list returning no commit Yann Dirson
  2006-06-11 12:04 ` [PATCH 2/3] cg-admin-rewritehist: catch errors in -r argument early Yann Dirson
@ 2006-06-11 12:05 ` Yann Dirson
  2 siblings, 0 replies; 4+ messages in thread
From: Yann Dirson @ 2006-06-11 12:05 UTC (permalink / raw)
  To: Petr Baudis; +Cc: git


This is a fix for 95621e54cedef1c4a270af5570a72fc1331b5fcb.

Signed-off-by: Yann Dirson <ydirson@altern.org>
---

 cg-admin-rewritehist |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cg-admin-rewritehist b/cg-admin-rewritehist
index 7cbdb30..6dd8b92 100755
--- a/cg-admin-rewritehist
+++ b/cg-admin-rewritehist
@@ -157,7 +157,7 @@ while optparse; do
 		git-rev-parse "$OPTARG" >/dev/null || die "Unknown revision '$OPTARG'"
 		git-rev-parse "$OPTARG^" >/dev/null || die "Revision '$OPTARG' does not have parents, check what you really want"
 		startrev="^$OPTARG^ $OPTARG $startrev"
-		startrevparents="$OPTARG $startrevparents"
+		startrevparents="$OPTARG^ $startrevparents"
 	elif optparse --env-filter=; then
 		filter_env="$OPTARG"
 	elif optparse --tree-filter=; then

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] cg-admin-rewritehist: catch git-rev-list returning no commit
  2006-06-11 12:04 ` [PATCH 1/3] cg-admin-rewritehist: catch git-rev-list returning no commit Yann Dirson
@ 2006-06-17 23:21   ` Petr Baudis
  0 siblings, 0 replies; 4+ messages in thread
From: Petr Baudis @ 2006-06-17 23:21 UTC (permalink / raw)
  To: Yann Dirson; +Cc: git

Dear diary, on Sun, Jun 11, 2006 at 02:04:55PM CEST, I got a letter
where Yann Dirson <ydirson@altern.org> said that...
> Signed-off-by: Yann Dirson <ydirson@altern.org>
> ---
> 
>  cg-admin-rewritehist |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/cg-admin-rewritehist b/cg-admin-rewritehist
> index 861c7f6..fe3f210 100755
> --- a/cg-admin-rewritehist
> +++ b/cg-admin-rewritehist
> @@ -199,6 +199,10 @@ done
>  git-rev-list --topo-order HEAD $startrev | tac >../revs
>  commits=$(cat ../revs | wc -l)
>  
> +if [ $commits -eq 0 ]; then
> +    die "Found nothing to rewrite"
> +fi
> +
>  i=0
>  while read commit; do
>  	i=$((i+1))

Thanks, applied.

Dear diary, on Sun, Jun 11, 2006 at 02:04:57PM CEST, I got a letter
where Yann Dirson <ydirson@altern.org> said that...
> Signed-off-by: Yann Dirson <ydirson@altern.org>
> ---
> 
>  cg-admin-rewritehist |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/cg-admin-rewritehist b/cg-admin-rewritehist
> index fe3f210..7cbdb30 100755
> --- a/cg-admin-rewritehist
> +++ b/cg-admin-rewritehist
> @@ -154,6 +154,8 @@ while optparse; do
>  	if optparse -d=; then
>  		tempdir="$OPTARG"
>  	elif optparse -r=; then
> +		git-rev-parse "$OPTARG" >/dev/null || die "Unknown revision '$OPTARG'"
> +		git-rev-parse "$OPTARG^" >/dev/null || die "Revision '$OPTARG' does not have parents, check what you really want"
>  		startrev="^$OPTARG^ $OPTARG $startrev"
>  		startrevparents="$OPTARG $startrevparents"
>  	elif optparse --env-filter=; then

Thanks, I've adapted it to the current codebase.

Dear diary, on Sun, Jun 11, 2006 at 02:05:00PM CEST, I got a letter
where Yann Dirson <ydirson@altern.org> said that...
> This is a fix for 95621e54cedef1c4a270af5570a72fc1331b5fcb.
> 
> Signed-off-by: Yann Dirson <ydirson@altern.org>
> ---
> 
>  cg-admin-rewritehist |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/cg-admin-rewritehist b/cg-admin-rewritehist
> index 7cbdb30..6dd8b92 100755
> --- a/cg-admin-rewritehist
> +++ b/cg-admin-rewritehist
> @@ -157,7 +157,7 @@ while optparse; do
>  		git-rev-parse "$OPTARG" >/dev/null || die "Unknown revision '$OPTARG'"
>  		git-rev-parse "$OPTARG^" >/dev/null || die "Revision '$OPTARG' does not have parents, check what you really want"
>  		startrev="^$OPTARG^ $OPTARG $startrev"
> -		startrevparents="$OPTARG $startrevparents"
> +		startrevparents="$OPTARG^ $startrevparents"
>  	elif optparse --env-filter=; then
>  		filter_env="$OPTARG"
>  	elif optparse --tree-filter=; then

Thanks; I've already applied a patch similar in spirit from someone
else.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
A person is just about as big as the things that make them angry.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-06-17 23:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20060611120431.12116.74005.stgit@gandelf.nowhere.earth>
2006-06-11 12:04 ` [PATCH 1/3] cg-admin-rewritehist: catch git-rev-list returning no commit Yann Dirson
2006-06-17 23:21   ` Petr Baudis
2006-06-11 12:04 ` [PATCH 2/3] cg-admin-rewritehist: catch errors in -r argument early Yann Dirson
2006-06-11 12:05 ` [PATCH 3/3] cg-admin-rewritehist: seed the map with the parent of the -r arg, not with itself Yann Dirson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).