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

Re: [PATCH 6/6] remove .keep pack lock files when done with refs update

From
Nicolas Pitre <nico@cam.org>
Date
Nov 2, 2006, 15:09 UTC
Message-ID
<Pine.LNX.4.64.0611020959410.11384@xanadu.home>
In-Reply-To
<7vzmbav2n9.fsf@assigned-by-dhcp.cox.net>
On Wed, 1 Nov 2006, Junio C Hamano wrote:
Show 15 quoted lines
> Nicolas Pitre <nico@cam.org> writes:
> 
> > --- a/git-fetch.sh
> > +++ b/git-fetch.sh
> > @@ -51,7 +51,7 @@ do
> >  		verbose=Yes
> >  		;;
> >  	-k|--k|--ke|--kee|--keep)
> > -		keep=--keep
> > +		keep=-k -k
> >  		;;
> >  	--reflog-action=*)
> >  		rloga=`expr "z$1" : 'z-[^=]*=\(.*\)'`
> 
> Micronit.  This cannot be right without quoting.
OK.  Shell programming isn't really my turf.
Another area of that patch I'm not really sure of is this:
@@ -408,6 +415,7 @@ fetch_main () {
          append_fetch_head "$sha1" "$remote" \
                  "$remote_name" "$remote_nick" "$local_name" "$not_for_merge"
       done
+      if [ "$pack_lockfile" ]; then rm -f "$pack_lockfile"; fi
     ) || exit ;;
   esac

How can I make sure to not clobber a non-zero return code with the rm 
that would prevent the exit while still performing the rm in all cases?
Previous: Junio C HamanoNext: Nicolas Pitre
Message 9 of 13 in “Allow pack header preprocessing before unpack-objects/index-pack.”
  1. 1/6 Allow pack header preprocessing before unpack-objects/index-pack.Nicolas Pitre, Nov 1, 2006
  2. 2/6 Teach receive-pack how to keep pack files based on object count.Nicolas Pitre, Nov 1, 2006
  3. 3/6 git-fetch can use both --thin and --keep with fetch-pack nowNicolas Pitre, Nov 1, 2006
  4. 4/6 improve fetch-pack's handling of kept packsNicolas Pitre, Nov 1, 2006
  5. 5/6 have index-pack create .keep file more carefullyNicolas Pitre, Nov 1, 2006
  6. 6/6 remove .keep pack lock files when done with refs updateNicolas Pitre, Nov 1, 2006
  7. Shawn PearceNov 2, 2006
  8. Junio C HamanoNov 2, 2006
  9. Nicolas PitreNov 2, 2006
  10. Nicolas PitreNov 2, 2006
  11. Junio C HamanoNov 3, 2006
  12. Junio C HamanoNov 1, 2006
  13. Nicolas PitreNov 2, 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.