git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Use warning function instead of fprintf(stderr, "Warning: ...").
@ 2010-01-03 16:20 Thiago Farina
  2010-01-04  0:18 ` Nanako Shiraishi
  0 siblings, 1 reply; 3+ messages in thread
From: Thiago Farina @ 2010-01-03 16:20 UTC (permalink / raw)
  To: gitster; +Cc: git

Signed-off-by: Thiago Farina <tfransosi@gmail.com>
---
Removed the LF from the end of the strings.

 bisect.c     |    4 ++--
 builtin-mv.c |    4 +---
 http.c       |    2 +-
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/bisect.c b/bisect.c
index dc18db8..f1a1f84 100644
--- a/bisect.c
+++ b/bisect.c
@@ -813,11 +813,11 @@ static void handle_skipped_merge_base(const unsigned char *mb)
 	char *bad_hex = sha1_to_hex(current_bad_sha1);
 	char *good_hex = join_sha1_array_hex(&good_revs, ' ');
 
-	fprintf(stderr, "Warning: the merge base between %s and [%s] "
+	warning("the merge base between %s and [%s] "
 		"must be skipped.\n"
 		"So we cannot be sure the first bad commit is "
 		"between %s and %s.\n"
-		"We continue anyway.\n",
+		"We continue anyway.",
 		bad_hex, good_hex, mb_hex, bad_hex);
 	free(good_hex);
 }
diff --git a/builtin-mv.c b/builtin-mv.c
index f633d81..8247186 100644
--- a/builtin-mv.c
+++ b/builtin-mv.c
@@ -169,9 +169,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
 				 * check both source and destination
 				 */
 				if (S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)) {
-					fprintf(stderr, "Warning: %s;"
-							" will overwrite!\n",
-							bad);
+					warning("%s; will overwrite!", bad);
 					bad = NULL;
 				} else
 					bad = "Cannot overwrite";
diff --git a/http.c b/http.c
index ed6414a..455732f 100644
--- a/http.c
+++ b/http.c
@@ -1244,7 +1244,7 @@ int finish_http_object_request(struct http_object_request *freq)
 	process_http_object_request(freq);
 
 	if (freq->http_code == 416) {
-		fprintf(stderr, "Warning: requested range invalid; we may already have all the data.\n");
+		warning("requested range invalid; we may already have all the data.");
 	} else if (freq->curl_result != CURLE_OK) {
 		if (stat(freq->tmpfile, &st) == 0)
 			if (st.st_size == 0)
-- 
1.6.6.75.g37bae

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

* Re: [PATCH v2] Use warning function instead of fprintf(stderr, "Warning: ...").
  2010-01-03 16:20 [PATCH v2] Use warning function instead of fprintf(stderr, "Warning: ...") Thiago Farina
@ 2010-01-04  0:18 ` Nanako Shiraishi
  2010-01-04  0:41   ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Nanako Shiraishi @ 2010-01-04  0:18 UTC (permalink / raw)
  To: Thiago Farina; +Cc: gitster, git

Quoting Thiago Farina <tfransosi@gmail.com>

> Signed-off-by: Thiago Farina <tfransosi@gmail.com>
> ---
> Removed the LF from the end of the strings.

Trying this patch makes t6030-bisect-porcelain.sh fail for me. Was this tested at all?

-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/

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

* Re: [PATCH v2] Use warning function instead of fprintf(stderr, "Warning: ...").
  2010-01-04  0:18 ` Nanako Shiraishi
@ 2010-01-04  0:41   ` Junio C Hamano
  0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2010-01-04  0:41 UTC (permalink / raw)
  To: Nanako Shiraishi; +Cc: Thiago Farina, gitster, git

Nanako Shiraishi <nanako3@lavabit.com> writes:

> Quoting Thiago Farina <tfransosi@gmail.com>
>
>> Signed-off-by: Thiago Farina <tfransosi@gmail.com>
>> ---
>> Removed the LF from the end of the strings.
>
> Trying this patch makes t6030-bisect-porcelain.sh fail for me. Was this tested at all?

I noticed it as well; will squash this in.

diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index def397c..c51865f 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -423,7 +423,7 @@ test_expect_success 'skipped merge base when good and bad are siblings' '
 	grep "merge base must be tested" my_bisect_log.txt &&
 	grep $HASH4 my_bisect_log.txt &&
 	git bisect skip > my_bisect_log.txt 2>&1 &&
-	grep "Warning" my_bisect_log.txt &&
+	grep "warning" my_bisect_log.txt &&
 	grep $SIDE_HASH6 my_bisect_log.txt &&
 	git bisect reset
 '

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

end of thread, other threads:[~2010-01-04  0:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-03 16:20 [PATCH v2] Use warning function instead of fprintf(stderr, "Warning: ...") Thiago Farina
2010-01-04  0:18 ` Nanako Shiraishi
2010-01-04  0:41   ` Junio C Hamano

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 NNTP newsgroup(s).