All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: git@vger.kernel.org
Subject: [RFC] exit code from git fetch
Date: Thu, 16 Mar 2006 22:01:12 -0800	[thread overview]
Message-ID: <7vek116253.fsf@assigned-by-dhcp.cox.net> (raw)

When "git fetch" fails because the remote unexpectedly rewound
its head and fast-forward check triggers, we issued a warning
but kept going anyway.  This proposed patch makes the command
exit with non-zero status.

I think this is a sensible change and makes it easier to use
from scripts, but it might have other issues.  For example when
you are tracking more than one heads from the remote, and the
first one fast-forwards but the second one doesn't, it updates
the first one and then stops.  If we happen to process the
rewound one first, neither is updated because we stop at the
first one.  I think this particular discrepancy probably is not
worth worrying about, but there may be other more serious
fallouts we need to fix if we did this.

Comments?

---
diff --git a/git-fetch.sh b/git-fetch.sh
index 0346d4a..6835634 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -179,6 +179,7 @@ fast_forward_local () {
 			;;
 		*)
 			echo >&2 "  not updating."
+			exit 1
 			;;
 		esac
 	    }

             reply	other threads:[~2006-03-17  6:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-17  6:01 Junio C Hamano [this message]
2006-03-17  6:23 ` [RFC] exit code from git fetch Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vek116253.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.