git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cg-admin-rewritehist: Seed the commit map with the parents specified with -r.
@ 2006-04-14 18:54 Johannes Sixt
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Sixt @ 2006-04-14 18:54 UTC (permalink / raw)
  To: git

When the first commit is manufactured, its parents are looked up in the
commit map. However, without this patch the map is always empty at that time.
If the entire history is rewritten, this is no problem because the first
commit does not have any parents anyway. However, if -r is used to constrain
rewriting to only part of the history, this first commit is manufactured
incorrectly without parents because 'cat' fails.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>

---

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

ec09427d1fb4097c15fd6df4f07049a536bb7d2c
diff --git a/cg-admin-rewritehist b/cg-admin-rewritehist
index 9c49d80..b72c641 100755
--- a/cg-admin-rewritehist
+++ b/cg-admin-rewritehist
@@ -138,6 +138,7 @@ _git_requires_root=1
 
 tempdir=.git-rewrite
 startrev=
+startrevparents=
 filter_env=
 filter_tree=
 filter_index=
@@ -149,6 +150,7 @@ while optparse; do
 		tempdir="$OPTARG"
 	elif optparse -r=; then
 		startrev="^$OPTARG $OPTARG $startrev"
+		startrevparents="$OPTARG $startrevparents"
 	elif optparse --env-filter=; then
 		filter_env="$OPTARG"
 	elif optparse --tree-filter=; then
@@ -182,6 +184,11 @@ ret=0
 
 
 mkdir ../map # map old->new commit ids for rewriting parents
+
+# seed with identity mappings for the parents where we start off
+for commit in $startrevparents; do
+	echo $commit > ../map/$commit
+done
 
 git-rev-list --topo-order HEAD $startrev | tac >../revs
 commits=$(cat ../revs | wc -l)
-- 
1.3.0.rc2

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

* [PATCH] cg-admin-rewritehist: Seed the commit map with the parents specified with -r.
@ 2006-04-29 21:45 Johannes Sixt
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Sixt @ 2006-04-29 21:45 UTC (permalink / raw)


When the first commit is manufactured, its parents are looked up in the
commit map. However, without this patch the map is always empty at that time.
If the entire history is rewritten, this is no problem because the first
commit does not have any parents anyway. However, if -r is used to constrain
rewriting to only part of the history, this first commit is manufactured
incorrectly without parents because 'cat' fails.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>

---

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

977fc81815877a1e72040355b221fe8d62593eb7
diff --git a/cg-admin-rewritehist b/cg-admin-rewritehist
index 9fa4c2a..7dd83cf 100755
--- a/cg-admin-rewritehist
+++ b/cg-admin-rewritehist
@@ -141,6 +141,7 @@ _git_requires_root=1
 
 tempdir=.git-rewrite
 startrev=
+startrevparents=
 filter_env=
 filter_tree=
 filter_index=
@@ -152,6 +153,7 @@ while optparse; do
 		tempdir="$OPTARG"
 	elif optparse -r=; then
 		startrev="^$OPTARG^ $OPTARG $startrev"
+		startrevparents="$OPTARG^ $startrevparents"
 	elif optparse --env-filter=; then
 		filter_env="$OPTARG"
 	elif optparse --tree-filter=; then
@@ -186,6 +188,12 @@ ret=0
 
 mkdir ../map # map old->new commit ids for rewriting parents
 
+# seed with identity mappings for the parents where we start off
+for commit in $startrevparents; do
+	commit="$(git-rev-parse $commit)"
+	echo $commit > ../map/$commit
+done
+
 git-rev-list --topo-order HEAD $startrev | tac >../revs
 commits=$(cat ../revs | wc -l)
 
-- 
1.3.1.gaa6b

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

* [PATCH] cg-admin-rewritehist: Seed the commit map with the parents specified with -r.
@ 2006-05-04 19:36 Johannes Sixt
  0 siblings, 0 replies; 3+ messages in thread
From: Johannes Sixt @ 2006-05-04 19:36 UTC (permalink / raw)
  To: git, Petr Baudis

When the first commit is manufactured, its parents are looked up in the
commit map. However, without this patch the map is always empty at that time.
If the entire history is rewritten, this is no problem because the first
commit does not have any parents anyway. However, if -r is used to constrain
rewriting to only part of the history, this first commit is manufactured
incorrectly without parents because 'cat' fails.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>

---

I'm posting this again, because I haven't received any feedback nor has
the patch been applied.

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

977fc81815877a1e72040355b221fe8d62593eb7
diff --git a/cg-admin-rewritehist b/cg-admin-rewritehist
index 9fa4c2a..7dd83cf 100755
--- a/cg-admin-rewritehist
+++ b/cg-admin-rewritehist
@@ -141,6 +141,7 @@ _git_requires_root=1
 
 tempdir=.git-rewrite
 startrev=
+startrevparents=
 filter_env=
 filter_tree=
 filter_index=
@@ -152,6 +153,7 @@ while optparse; do
 		tempdir="$OPTARG"
 	elif optparse -r=; then
 		startrev="^$OPTARG^ $OPTARG $startrev"
+		startrevparents="$OPTARG^ $startrevparents"
 	elif optparse --env-filter=; then
 		filter_env="$OPTARG"
 	elif optparse --tree-filter=; then
@@ -186,6 +188,12 @@ ret=0
 
 mkdir ../map # map old->new commit ids for rewriting parents
 
+# seed with identity mappings for the parents where we start off
+for commit in $startrevparents; do
+	commit="$(git-rev-parse $commit)"
+	echo $commit > ../map/$commit
+done
+
 git-rev-list --topo-order HEAD $startrev | tac >../revs
 commits=$(cat ../revs | wc -l)
 
-- 
1.3.1.gaa6b

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

end of thread, other threads:[~2006-05-04 19:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-29 21:45 [PATCH] cg-admin-rewritehist: Seed the commit map with the parents specified with -r Johannes Sixt
  -- strict thread matches above, loose matches on Subject: below --
2006-05-04 19:36 Johannes Sixt
2006-04-14 18:54 Johannes Sixt

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).