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

Re: [PATCH 9/9] refs: use warning() instead of fprintf(stderr, "warning: ")

From
Miklos Vajna <vmiklos@frugalware.org>
Date
Mar 24, 2009, 01:23 UTC
Message-ID
<20090324012334.GL27459@genesis.frugalware.org>
In-Reply-To
<40aa078e0903231817g41fd1bc1s296121d85923f7ea@mail.gmail.com>
On Tue, Mar 24, 2009 at 02:17:24AM +0100, Erik Faye-Lund <kusmabite@googlemail.com> wrote:
Show 10 quoted lines
> > @@ -996,7 +996,7 @@ int delete_ref(const char *refname, const unsigned char *sha1, int delopt)
> >
> >        err = unlink(git_path("logs/%s", lock->ref_name));
> >        if (err && errno != ENOENT)
> > -               fprintf(stderr, "warning: unlink(%s) failed: %s",
> > +               warning("unlink(%s) failed: %s",
> 
> Doesn't this add a newline? The original string doesn't have a '\n' at
> the end of the format-field, but AFAIK warning() terminates with one.
> I'm not saying it's a problem, I'm just pointing it out.

Yes, it adds. As Jeff pointed out earlier in this thread, the lack of newline was a bug:

http://article.gmane.org/gmane.comp.version-control.git/110783
Previous: Erik Faye-LundNext: Erik Faye-Lund
Message 12 of 16 in “fprintf(stderr, "warning: ") -> warning() patches”
  1. 0/9 fprintf(stderr, "warning: ") -> warning() patchesMiklos Vajna, Mar 24, 2009
  2. 1/9 http-push: using error() and warning() as appropriateMiklos Vajna, Mar 24, 2009
  3. 2/9 builtin-apply: use warning() instead of fprintf(stderr, "warning: ")Miklos Vajna, Mar 24, 2009
  4. 3/9 builtin-checkout: use warning() instead of fprintf(stderr, "warning: ")Miklos Vajna, Mar 24, 2009
  5. 4/9 builtin-fetch-pack: use warning() instead of fprintf(stderr, "warning: ")Miklos Vajna, Mar 24, 2009
  6. 5/9 builtin-init-db: use warning() instead of fprintf(stderr, "warning: ")Miklos Vajna, Mar 24, 2009
  7. 6/9 builtin-rm: use warning() instead of fprintf(stderr, "warning: ")Miklos Vajna, Mar 24, 2009
  8. 7/9 builtin-show-branch: use warning() instead of fprintf(stderr, "warning: ")Miklos Vajna, Mar 24, 2009
  9. 8/9 builtin-show-ref: use warning() instead of fprintf(stderr, "warning: ")Miklos Vajna, Mar 24, 2009
  10. 9/9 refs: use warning() instead of fprintf(stderr, "warning: ")Miklos Vajna, Mar 24, 2009
  11. Erik Faye-LundMar 24, 2009
  12. Miklos VajnaMar 24, 2009
  13. Erik Faye-LundMar 24, 2009
  14. Erik Faye-LundMar 24, 2009
  15. Jeff KingMar 24, 2009
  16. Junio C HamanoMar 24, 2009

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.