git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Fwd: [MinGW port] Unable to repack on Clearcase dynamic views

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
May 30, 2007, 15:43 UTC
Message-ID
<fcaeb9bf0705300843v10782be3i985d10144535868c@mail.gmail.com>
In-Reply-To
<fcaeb9bf0705300840w221c46c1y742388fc9e61c2fa@mail.gmail.com>
I'm sorry, forgot to CC the list.
---------- Forwarded message ----------
From: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date: May 30, 2007 11:40 AM
Subject: Re: [MinGW port] Unable to repack on Clearcase dynamic views
To: Johannes Sixt <J.Sixt@eudaptics.com>
On 5/30/07, Johannes Sixt <J.Sixt@eudaptics.com> wrote:
Show 10 quoted lines
> 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.

Well, I'm not sure I understand it. git-repack with the patch applied runs fine for me. Can you explain it more detail please?

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

Because I'm not sure what that command is for :) I suspect that packs (or anything inside .git/objects) are read-only and the author want to make sure no one can write to the packs as soon as they are created. The other way to do is to move 'chmod a-w' down several lines -- we only make those files read-only after moving them to .git/objects/packs.

Show 40 quoted lines
>
> -- Hannes
>
> >
> > diff --git a/git-repack.sh b/git-repack.sh
> > index acb78ba..76a9525 100755
> > --- a/git-repack.sh
> > +++ b/git-repack.sh
> > @@ -86,10 +86,22 @@ else
> >         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."
> > -               exit 1
> > +               # Clearcase dynamic views do not allow to move file without write permission
> > +               # Try the second time with write allowed
> > +               chmod u+w "$PACKTMP-$name.pack"
> > +               chmod u+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."
> > +                       exit 1
> > +               }
> > +               chmod a-w "$PACKDIR/pack-$name.pack"
> > +               chmod a-w "$PACKDIR/pack-$name.idx"
> >         }
> >         rm -f "$PACKDIR/old-pack-$name.pack" "$PACKDIR/old-pack-$name.idx"
> >  fi
> >
> > --
> > Duy
>
>

-- Duy

-- 
Duy
Previous: Johannes Sixt
Message 14 of 14 in “[MinGW port] Unable to repack on Clearcase dynamic views”
  1. Nguyen Thai Ngoc DuyMay 30, 2007
  2. Paolo TetiMay 30, 2007
  3. Nguyen Thai Ngoc DuyMay 30, 2007
  4. Paolo TetiMay 30, 2007
  5. Robin RosenbergMay 30, 2007
  6. Johannes SchindelinMay 30, 2007
  7. Nguyen Thai Ngoc DuyMay 30, 2007
  8. Robin RosenbergMay 30, 2007
  9. Nguyen Thai Ngoc DuyMay 30, 2007
  10. Paolo TetiMay 31, 2007
  11. Robin RosenbergMay 31, 2007
  12. Jan HudecJun 1, 2007
  13. Johannes SixtMay 30, 2007
  14. Fwd: [MinGW port] Unable to repack on Clearcase dynamic viewsNguyen Thai Ngoc Duy, May 30, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.