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

Re: [PATCH 5/6] log: pass rev_info to git_log_config()

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 4, 2012, 07:05 UTC
Message-ID
<7v1uhe3efa.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1349314419-8397-6-git-send-email-gitster@pobox.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 14 quoted lines
> Call init_revisions() first to prepare the revision traversal
> parameters and pass it to git_log_config(), so that necessary bits
> in the traversal parameters can be tweaked before we call the
> command line parsing infrastructure setup_revisions() from
> the cmd_log_init_finish() function.
>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
>
>  * This is made separate from the next one that touches the contents
>    of "rev" to make sure the existing code does not depend on the
>    current initialization order.  I do not think it does but better
>    be careful to keep the history easier to bisect, than be sorry
>    when an issue does appear.

And I was right X-<. This does break the assumption the recent diff.context series makes.

What happens is that
    - init_revisions() initializes revs->grep_filter; that is why this
      patch wanted to call it first, so that it can futz with it
      from git_config().
    - however, init_revisions() also calls diff_setup(), and the
      diff machinery initializes revs->diffopt->context from
      diff_context_default.  Compiled in default of this value is 3,
      but the diff.context series wants to update this variable with
      the configuration before this call happens.
So we would need to do something like:
    - call git_log_config() first to let diff_context_default
      updated from the configuration as before.  find the values of
      grep.* defaults at the same time, but stash it away in a
      separate "struct grep_opt" (yuck);
    - call init_revisions() and let it initialize revs->grep_filter
      and revs->diffopt as before;
    - copy the grep.* defaults we learned during git_log_config() to
      revs->grep_filter.
which is a bit yucky, but survivable.
I'll fix these two patches up later.
Previous: Junio C HamanoNext: Junio C Hamano
Message 15 of 23 in “[ANNOUNCE] Git v1.8.0-rc0”
  1. Junio C HamanoOct 1, 2012
  2. grep.patternType (was: Re: [ANNOUNCE] Git v1.8.0-rc0)Junio C Hamano, Oct 3, 2012
  3. Junio C HamanoOct 3, 2012
  4. Michal KiedrowiczOct 4, 2012
  5. J SmithOct 5, 2012
  6. 0/6 Tying loose ends of extended "grep"Junio C Hamano, Oct 4, 2012
  7. 1/6 grep: move configuration support to top-level grep.[ch]Junio C Hamano, Oct 4, 2012
  8. 2/6 grep: move pattern-type bits support to top-level grep.[ch]Junio C Hamano, Oct 4, 2012
  9. 3/6 log --grep: use the same helper to set -E/-F options as "git grep"Junio C Hamano, Oct 4, 2012
  10. Jeff KingOct 4, 2012
  11. 4/6 log --grep: accept --basic-regexp and --perl-regexpJunio C Hamano, Oct 4, 2012
  12. Jeff KingOct 4, 2012
  13. Junio C HamanoOct 4, 2012
  14. 5/6 log: pass rev_info to git_log_config()Junio C Hamano, Oct 4, 2012
  15. Junio C HamanoOct 4, 2012
  16. Junio C HamanoOct 5, 2012
  17. Jeff KingOct 5, 2012
  18. Junio C HamanoOct 5, 2012
  19. 6/6 log --grep: honor grep.patterntype etc. configuration variablesJunio C Hamano, Oct 4, 2012
  20. Jeff KingOct 4, 2012
  21. Junio C HamanoOct 4, 2012
  22. Jeff KingOct 4, 2012
  23. Junio C HamanoOct 4, 2012

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.