Hi,
On clearcase dynamic views (kind of virtual drives), "mv -f a b" won't
work if "a" is read-only. Because git-repack.sh removes all write
permission before moving packs, it fails on clearcase dynamic views.
My approach is rather ugly. Does anyone have a better solution?
@@ -86,10 +86,22 @@ elsemv-f"$PACKTMP-$name.idx""$PACKDIR/pack-$name.idx"&&test-f"$PACKDIR/pack-$name.pack"&&test-f"$PACKDIR/pack-$name.idx"||{-echo>&2"Couldn't replace the existing pack with updated one."-echo>&2"The original set of packs have been saved as"-echo>&2"old-pack-$name.{pack,idx} in $PACKDIR."-exit1+# Clearcase dynamic views do not allow to move file without write permission+# Try the second time with write allowed+chmodu+w"$PACKTMP-$name.pack"+chmodu+w"$PACKTMP-$name.idx"++mv-f"$PACKTMP-$name.pack""$PACKDIR/pack-$name.pack"&&+mv-f"$PACKTMP-$name.idx""$PACKDIR/pack-$name.idx"&&+test-f"$PACKDIR/pack-$name.pack"&&+test-f"$PACKDIR/pack-$name.idx"||{+echo>&2"Couldn't replace the existing pack with updated one."+echo>&2"The original set of packs have been saved as"+echo>&2"old-pack-$name.{pack,idx} in $PACKDIR."+exit1+}+chmoda-w"$PACKDIR/pack-$name.pack"+chmoda-w"$PACKDIR/pack-$name.idx"}rm-f"$PACKDIR/old-pack-$name.pack""$PACKDIR/old-pack-$name.idx"fi
From: Paolo Teti <hidden> Date: 2016-06-15 22:43:13
2007/5/30, Nguyen Thai Ngoc Duy [off-list ref]:
Hi,
On clearcase dynamic views (kind of virtual drives), "mv -f a b" won't
work if "a" is read-only. Because git-repack.sh removes all write
permission before moving packs, it fails on clearcase dynamic views.
My approach is rather ugly. Does anyone have a better solution?
I hate clearcase, but honestly I have used it forced by a customer..
The real problem is why you need to do a repack in a CC view, but..
to move a file in a Clearcase view you have to use 'cleartool mv ...'
(or 'cleartool relocate') and not the UNIX mv command...
..and he directory where the element to be moved or renamed resides
must be checked out.
From: Johannes Sixt <hidden> Date: 2016-06-15 22:43:13
Nguyen Thai Ngoc Duy wrote:
On clearcase dynamic views (kind of virtual drives), "mv -f a b" won't
work if "a" is read-only. Because git-repack.sh removes all write
permission before moving packs, it fails on clearcase dynamic views.
My approach is rather ugly. Does anyone have a better solution?
If you do two 'git repack -a -d' in a row, the second one fails even
with this patch, right? To fix it, you must 'chmod u+w' in the for-loop
right above this hunk, too.
Since you 'chmod a-w' after the mv, why not just remove the first ones
before the first mv? Then you can get rid of the second try.
-- Hannes
@@ -86,10 +86,22 @@ elsemv-f"$PACKTMP-$name.idx""$PACKDIR/pack-$name.idx"&&test-f"$PACKDIR/pack-$name.pack"&&test-f"$PACKDIR/pack-$name.idx"||{-echo>&2"Couldn't replace the existing pack with updated one."-echo>&2"The original set of packs have been saved as"-echo>&2"old-pack-$name.{pack,idx} in $PACKDIR."-exit1+# Clearcase dynamic views do not allow to move file without write permission+# Try the second time with write allowed+chmodu+w"$PACKTMP-$name.pack"+chmodu+w"$PACKTMP-$name.idx"++mv-f"$PACKTMP-$name.pack""$PACKDIR/pack-$name.pack"&&+mv-f"$PACKTMP-$name.idx""$PACKDIR/pack-$name.idx"&&+test-f"$PACKDIR/pack-$name.pack"&&+test-f"$PACKDIR/pack-$name.idx"||{+echo>&2"Couldn't replace the existing pack with updated one."+echo>&2"The original set of packs have been saved as"+echo>&2"old-pack-$name.{pack,idx} in $PACKDIR."+exit1+}+chmoda-w"$PACKDIR/pack-$name.pack"+chmoda-w"$PACKDIR/pack-$name.idx"}rm-f"$PACKDIR/old-pack-$name.pack""$PACKDIR/old-pack-$name.idx"fi--
Hi,
On clearcase dynamic views (kind of virtual drives), "mv -f a b" won't
work if "a" is read-only. Because git-repack.sh removes all write
permission before moving packs, it fails on clearcase dynamic views.
My approach is rather ugly. Does anyone have a better solution?
I hate clearcase, but honestly I have used it forced by a customer..
The real problem is why you need to do a repack in a CC view, but..
I don't like it either :) But you remind me the Matthias' workdir
patchset. With that I can move out .git to a real drive/filesystem
(which should also give better performance).
I think it's a valid use case. Anyone remember why Matthias' patchset
was dropped?
It was last mentioned in
http://article.gmane.org/gmane.comp.version-control.git/43041
Junio, Matthias? May I help?
to move a file in a Clearcase view you have to use 'cleartool mv ...'
(or 'cleartool relocate') and not the UNIX mv command...
'cleartool mv' is used for clearcase-manages files. My git repository
are private files.
..and he directory where the element to be moved or renamed resides
must be checked out.
From: Robin Rosenberg <hidden> Date: 2016-06-15 22:43:13
onsdag 30 maj 2007 skrev Nguyen Thai Ngoc Duy:
On 5/30/07, Paolo Teti [off-list ref] wrote:
quoted
2007/5/30, Nguyen Thai Ngoc Duy [off-list ref]:
quoted
Hi,
On clearcase dynamic views (kind of virtual drives), "mv -f a b" won't
work if "a" is read-only. Because git-repack.sh removes all write
permission before moving packs, it fails on clearcase dynamic views.
My approach is rather ugly. Does anyone have a better solution?
I hate clearcase, but honestly I have used it forced by a customer..
The real problem is why you need to do a repack in a CC view, but..
I don't like it either :) But you remind me the Matthias' workdir
patchset. With that I can move out .git to a real drive/filesystem
(which should also give better performance).
I think it's a valid use case. Anyone remember why Matthias' patchset
was dropped?
It was last mentioned in
http://article.gmane.org/gmane.comp.version-control.git/43041
Junio, Matthias? May I help?
Wasn't because it's better to make .git a link to a repository somewhere
else? Just a guess.
ln -s /somewhere/repo/.git .git
Works fine for me (yes, in a clearcase dynamic view).
BTW, Does anyone have something like git-cvsexportcommit for clearcase?
-- robin
From: Johannes Schindelin <hidden> Date: 2016-06-15 22:43:13
Hi,
On Wed, 30 May 2007, Robin Rosenberg wrote:
Wasn't because it's better to make .git a link to a repository somewhere
else? Just a guess.
ln -s /somewhere/repo/.git .git
Works fine for me (yes, in a clearcase dynamic view).
MinGW does not know symbolic links (at least not on the common
filesystems).
Ciao,
Dscho
Hi,
On clearcase dynamic views (kind of virtual drives), "mv -f a b" won't
work if "a" is read-only. Because git-repack.sh removes all write
permission before moving packs, it fails on clearcase dynamic views.
My approach is rather ugly. Does anyone have a better solution?
I hate clearcase, but honestly I have used it forced by a customer..
The real problem is why you need to do a repack in a CC view, but..
I don't like it either :) But you remind me the Matthias' workdir
patchset. With that I can move out .git to a real drive/filesystem
(which should also give better performance).
I think it's a valid use case. Anyone remember why Matthias' patchset
was dropped?
It was last mentioned in
http://article.gmane.org/gmane.comp.version-control.git/43041
Junio, Matthias? May I help?
Wasn't because it's better to make .git a link to a repository somewhere
else? Just a guess.
ln -s /somewhere/repo/.git .git
Works fine for me (yes, in a clearcase dynamic view).
Clearcase symlinks require checkout/checkin stuffs that I really don't
want to mess up with. Moreover, it seems not work if the link
destination is out of clearcase view (which is what I wanted).
--
Duy
From: Robin Rosenberg <hidden> Date: 2016-06-15 22:43:13
onsdag 30 maj 2007 skrev Nguyen Thai Ngoc Duy:
Clearcase symlinks require checkout/checkin stuffs that I really don't
want to mess up with. Moreover, it seems not work if the link
destination is out of clearcase view (which is what I wanted).
Well obviously.. :/
I guess junction points in dynamic views are out of the question too. Would
setting GIT_DIR be too cumbersome?
-- robin
Clearcase symlinks require checkout/checkin stuffs that I really don't
want to mess up with. Moreover, it seems not work if the link
destination is out of clearcase view (which is what I wanted).
Well obviously.. :/
I guess junction points in dynamic views are out of the question too. Would
setting GIT_DIR be too cumbersome?
From: Robin Rosenberg <hidden> Date: 2016-06-15 22:43:13
torsdag 31 maj 2007 skrev Paolo Teti:
2007/5/30, Robin Rosenberg [off-list ref]:
quoted
BTW, Does anyone have something like git-cvsexportcommit for clearcase?
a stupid workaround is git-cvsexportcommit + clearimport /clearexport_cvs.
-
That would require a clearcase to cvs converter, wouldn't it, so I'd have something to commit to..
Even more stupid than my attempt at a clearcase to git converter.
-- robin
From: Jan Hudec <hidden> Date: 2016-06-15 22:43:13
On Wed, May 30, 2007 at 20:28:15 +0200, Robin Rosenberg wrote:
Wasn't because it's better to make .git a link to a repository somewhere
else? Just a guess.
ln -s /somewhere/repo/.git .git
Works fine for me (yes, in a clearcase dynamic view).
It works for me too. It requires cygwin version of git though, since windows
don't have native symlinks.
BTW, Does anyone have something like git-cvsexportcommit for clearcase?
No, but it should not be too hard to create.
If you want to quickly import something, you can try starting with something
like:
diff clearcase-view git-checkout > p
lsdiff p | xargs -d '\n' cleartool checkout
patch -p $n < p
You'll have to sort out which directories to run which command in and how
many components to strip with -p in the patch. It also does not handle adding
and removing.
--
Jan 'Bulb' Hudec [off-list ref]