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

Re: [PATCH 1/3] for-each-ref: introduce %C(...) for color

From
Antoine Pelisse <apelisse@gmail.com>
Date
May 24, 2013, 20:56 UTC
Message-ID
<CALWbr2yuEczF-G7uJ0r-teUJrZowrY8mYm+xwJmv4+CT6NgDPA@mail.gmail.com>
In-Reply-To
<1369405177-7855-2-git-send-email-artagnon@gmail.com>

On Fri, May 24, 2013 at 4:19 PM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:

Show 19 quoted lines
> @@ -928,12 +936,22 @@ static void emit(const char *cp, const char *ep)
>  static void show_ref(struct refinfo *info, const char *format, int quote_style)
>  {
>         const char *cp, *sp, *ep;
> +       char color[COLOR_MAXLEN];
>
>         for (cp = format; *cp && (sp = find_next(cp)); cp = ep + 1) {
>                 ep = strchr(sp, ')');
>                 if (cp < sp)
>                         emit(cp, sp);
> -               print_value(info, parse_atom(sp + 2, ep), quote_style);
> +
> +               /* Do we have a color specification? */
> +               if (!prefixcmp(sp, "%C("))
> +                       color_parse_mem(sp + 3,
> +                                       ep - sp - 3,
> +                                       "--format ", color);
> +               else {
> +                       printf("%s", color);
Is it not possible for "color" to be used uninitialized here ?
Show 5 quoted lines
> +                       print_value(info, parse_atom(sp + 2, ep), quote_style);
> +               }
>         }
>         if (*cp) {
>                 sp = cp + strlen(cp);
Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 3 of 31 in “Towards a useable git-branch”
  1. 0/3 Towards a useable git-branchRamkumar Ramachandra, May 24, 2013
  2. 1/3 for-each-ref: introduce %C(...) for colorRamkumar Ramachandra, May 24, 2013
  3. Antoine PelisseMay 24, 2013
  4. Ramkumar RamachandraMay 25, 2013
  5. John KeepingMay 25, 2013
  6. Ramkumar RamachandraMay 25, 2013
  7. Antoine PelisseMay 25, 2013
  8. David AguilarMay 24, 2013
  9. Ramkumar RamachandraMay 25, 2013
  10. Eric SunshineMay 25, 2013
  11. 2/3 for-each-ref: introduce %(HEAD) markerRamkumar Ramachandra, May 24, 2013
  12. Philip OakleyMay 24, 2013
  13. 3/3 for-each-ref: introduce %(upstream:track[short])Ramkumar Ramachandra, May 24, 2013
  14. Duy NguyenMay 24, 2013
  15. Ramkumar RamachandraMay 24, 2013
  16. Junio C HamanoMay 24, 2013
  17. Ramkumar RamachandraMay 24, 2013
  18. Ramkumar RamachandraMay 24, 2013
  19. Duy NguyenMay 24, 2013
  20. Duy NguyenMay 25, 2013
  21. Duy NguyenMay 25, 2013
  22. Ramkumar RamachandraMay 25, 2013
  23. Ramkumar RamachandraMay 28, 2013
  24. Ramkumar RamachandraMay 28, 2013
  25. Duy NguyenMay 30, 2013
  26. Ramkumar RamachandraJun 4, 2013
  27. Duy NguyenJun 4, 2013
  28. Ramkumar RamachandraMay 28, 2013
  29. Duy NguyenMay 29, 2013
  30. Ramkumar RamachandraMay 29, 2013
  31. Duy NguyenMay 29, 2013

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.