git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] push: give early feedback
@ 2013-06-24 17:41 Ramkumar Ramachandra
  2013-06-24 18:04 ` Fredrik Gustafsson
  2013-06-24 18:28 ` Jeff King
  0 siblings, 2 replies; 8+ messages in thread
From: Ramkumar Ramachandra @ 2013-06-24 17:41 UTC (permalink / raw)
  To: Git List; +Cc: Junio C Hamano

There are many configuration variables that determine exactly what a
push does.  Give the user early feedback so that she has a chance to
abort if she doesn't mean to push those refspecs to that destination
like:

  $ git push
  # pushing refspecs 'master next' to ram (^C to abort)

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
 Goes without saying: this is an early preview.

 builtin/push.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/builtin/push.c b/builtin/push.c
index 2d84d10..085d5ab 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -330,6 +330,7 @@ static int do_push(const char *repo, int flags)
 {
 	int i, errs;
 	struct remote *remote = pushremote_get(repo);
+	struct strbuf sb = STRBUF_INIT;
 	const char **url;
 	int url_nr;
 
@@ -375,6 +376,11 @@ static int do_push(const char *repo, int flags)
 	}
 	errs = 0;
 	url_nr = push_url_of_remote(remote, &url);
+
+	for (i = 0; i < refspec_nr; i++)
+		strbuf_addf(&sb, "%s%s", refspec[i], i == refspec_nr - 1 ? "": " ");
+	printf("# pushing refspecs '%s' to %s (^C to abort)\n", sb.buf, remote->name);
+
 	if (url_nr) {
 		for (i = 0; i < url_nr; i++) {
 			struct transport *transport =
-- 
1.8.3.1.549.g1f3a412.dirty

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-06-24 19:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-24 17:41 [PATCH] push: give early feedback Ramkumar Ramachandra
2013-06-24 18:04 ` Fredrik Gustafsson
2013-06-24 18:24   ` Junio C Hamano
2013-06-24 18:28 ` Jeff King
2013-06-24 18:42   ` Ramkumar Ramachandra
2013-06-24 18:55     ` Jeff King
2013-06-24 19:24       ` Ramkumar Ramachandra
2013-06-24 19:39         ` Jeff King

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).