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

Re: [PATCH] git-repack: create new packs inside $PACKDIR, not cwd

From
MCMartin Langhoff (CatalystIT) <martin@catalyst.net.nz>
Date
Sep 4, 2006, 10:03 UTC
Message-ID
<44FBF9E0.9050800@catalyst.net.nz>
In-Reply-To
<7vr6ysneor.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
> In other words...

Can't be offline 2 hs to read a book... ;-) Actually, I had thought the pack reading code would focus on filenames following pack-<id>.pack pattern and corresponding idx files, and that .tmp-* was safe to have there. My bad.

BTW, I think there's a small error.
...
Show 11 quoted lines
> --- a/git-repack.sh
> +++ b/git-repack.sh
> @@ -24,8 +24,10 @@ do
>  	shift
>  done
>  
> -rm -f .tmp-pack-*
>  PACKDIR="$GIT_OBJECT_DIRECTORY/pack"
> +PACKTMP="$GIT_DIR/.tmp-$$-pack"
> +rm -f "$PACKTMP"-*
> +trap 'rm -f "$PACKTMP"-*' 0 1 2 3 15

Your packtmp includes $$ which means that rm -f "$PACKTMP" will only clear out old packs only if the pid of the old-and-probably-dead process matches ours... and then a hyphen.

so instead I propose...
+trap 'rm -f "$GIT_DIR/.tmp-*-pack"' 0 1 2 3 15
cheers,
martin
-- 
-----------------------------------------------------------------------
Martin @ Catalyst .Net .NZ  Ltd, PO Box 11-053, Manners St,  Wellington
WEB: http://catalyst.net.nz/           PHYS: Level 2, 150-154 Willis St
OFFICE: +64(4)916-7224                              MOB: +64(21)364-017
       Make things as simple as possible, but no simpler - Einstein
-----------------------------------------------------------------------

-- 
VGER BF report: U 0.900798
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 8 in “git-repack: create new packs inside $PACKDIR, not cwd”
  1. git-repack: create new packs inside $PACKDIR, not cwdMartin Langhoff, Sep 4, 2006
  2. Martin WaitzSep 4, 2006
  3. Junio C HamanoSep 4, 2006
  4. Junio C HamanoSep 4, 2006
  5. Martin Langhoff (CatalystIT)Sep 4, 2006
  6. Junio C HamanoSep 4, 2006
  7. Martin Langhoff (CatalystIT)Sep 4, 2006
  8. Junio C HamanoSep 4, 2006

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.