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

4 messages, 2 authors, 2016-08-11 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-08-11 19:41:32

Nicolas Pitre [off-list ref] writes:
quoted hunk
--- 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.

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

From: Nicolas Pitre <hidden>
Date: 2016-08-11 20:21:50

On Thu, 2 Nov 2006, Nicolas Pitre wrote:
quoted hunk
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?
OK looking at it again I think the || exit is only meant to match the 
exit 1 before that point. Since this is a subshell then the exit 1 
wouldn't exit it all on its own.  Otherwise there is no errors expected 
to trickle out of the while loop and I _think_ the above is correct.

Do you still want a new patch for the micronit quoting issue?

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

From: Nicolas Pitre <hidden>
Date: 2016-08-11 20:22:18

On Wed, 1 Nov 2006, Junio C Hamano wrote:
Nicolas Pitre [off-list ref] writes:
quoted
--- 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?

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

From: Junio C Hamano <hidden>
Date: 2016-08-11 20:25:43

Nicolas Pitre [off-list ref] writes:
On Thu, 2 Nov 2006, Nicolas Pitre wrote:
quoted
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?
OK looking at it again I think the || exit is only meant to match the 
exit 1 before that point. Since this is a subshell then the exit 1 
wouldn't exit it all on its own.  Otherwise there is no errors expected 
to trickle out of the while loop and I _think_ the above is correct.
I think so too.
Do you still want a new patch for the micronit quoting issue?
Not needed, will park them in "pu" and play with them --
hopefully in "next" by the end of the week.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help