git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pierre Habouzit <madcoder@debian.org>
To: gitster@pobox.com
Cc: git@vger.kernel.org
Subject: Preliminary patches to the diff.[hc] parseoptification
Date: Wed,  7 Nov 2007 11:20:25 +0100	[thread overview]
Message-ID: <1194430832-6224-1-git-send-email-madcoder@debian.org> (raw)

I'm currently working on the very involved task of migrating diff
options to parseopts. It's quite involved because for many reasons I
won't detail here, it needs to migrate those _and_ revisions options at
the same time (most of the diff options users _also_ use the revisions
ones).

So I'm trying to see some preliminary patches that I need to make this
the less disruptive possible: my goal is that people can use those
preliminary series bit by bit, and not a whole 10 to 20 patches (I
believe it will really take this amount in the end) at once with
breakages hard to find in the mess.

So in the coming days I'll probably send my work bit by bit when I feel
it won't change anymore.


Summary:
~~~~~~~

The 3 series are completely independent.

  + this is a patch to fix an issue that begin to irritate me and
    prevents me to build with -Werror.

    [1/1] Make gcc warning about empty if body go away.

  + this series add new features that are needed for the diff options.
    commit 1 implements them (see commit log,
    commits 2 to 4 use them in some commands that benefit from those.

    [1/4] parse-options new features.
    [2/4] Use OPT_SET_INT and OPT_BIT in builtin-branch
    [3/4] Use OPT_BIT in builtin-for-each-ref
    [4/4] Use OPT_BIT in builtin-pack-refs

  + this series does some modifications on the diff_options structure
    and the diff_opt_parse functions. Those are not fundamentally needed
    without parseopt, but parseopt will need them.

    Basically, diff_options had bitfields (the C :1 kind). parseopt cannot
    grok that portably, so I've converted these into a single
    `unsigned flags` with explicit masks to use (and helper macros to
    avoid overlong lines).

    The obvious goal is that I can use the OPTION_BIT feature from the
    previous series to fill them from parse_options.

    [1/2] Make the diff_options bitfields be an unsigned with explicit masks.
    [2/2] Reorder diff_opt_parse options more logically per topics.

Those patches are available on my public repository in the
ph/parseopt-stable branch.

ph/parseopt is my WIP and has many many horrible commits right now, that
I rebase -i to cleanse them once the big picture pleases me enough,
though people may want to look at diff.h in that branch to see where it
goes. I'm pleased to say that it seems I'll only need 3 diff-specific
callbacks, which is not a lot:

    http://git.madism.org/?p=git.git;a=blobdiff;f=diff.h;h=0e44e5;hp=6ff2b0;hb=def4eb;hpb=bdc1ab

I suppose that the split of this big macro is explanatory enough for the
reason behind commit 2/2 of the third series...


Diff stats:
~~~~~~~~~~

  + gcc issue:
     builtin-diff.c |    2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)

  + parseopt features:
     builtin-branch.c       |   44 ++++++++++++-----------------------
     builtin-for-each-ref.c |   19 ++++++++-------
     builtin-pack-refs.c    |   12 ++-------
     git-compat-util.h      |    1 
     parse-options.c        |   61 +++++++++++++++++++++++++++++++++++--------------
     parse-options.h        |   15 +++++++++++-
     6 files changed, 88 insertions(+), 64 deletions(-)

  + diff-cleanup:
     builtin-blame.c      |   10 +-
     builtin-diff-files.c |    4 +-
     builtin-diff-index.c |    4 +-
     builtin-diff-tree.c  |    9 +-
     builtin-diff.c       |   12 ++--
     builtin-log.c        |   24 +++---
     combine-diff.c       |   10 +-
     diff-lib.c           |   23 +++---
     diff.c               |  221 ++++++++++++++++++++++++++------------------------
     diff.h               |   40 ++++++----
     log-tree.c           |    6 +-
     merge-recursive.c    |    2 +-
     patch-ids.c          |    2 +-
     revision.c           |   22 +++---
     tree-diff.c          |   14 ++--
     15 files changed, 209 insertions(+), 194 deletions(-)

-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

             reply	other threads:[~2007-11-07 10:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-07 10:20 Pierre Habouzit [this message]
2007-11-07 10:20 ` [PATCH MISC 1/1] Make gcc warning about empty if body go away Pierre Habouzit
2007-11-07 10:20   ` [PATCH PARSEOPT 1/4] parse-options new features Pierre Habouzit
2007-11-07 10:20     ` [PATCH PARSEOPT 2/4] Use OPT_SET_INT and OPT_BIT in builtin-branch Pierre Habouzit
2007-11-07 10:20       ` [PATCH PARSEOPT 3/4] Use OPT_BIT in builtin-for-each-ref Pierre Habouzit
2007-11-07 10:20         ` [PATCH PARSEOPT 4/4] Use OPT_BIT in builtin-pack-refs Pierre Habouzit
2007-11-07 10:20           ` [PATCH DIFF-CLEANUP 1/2] Make the diff_options bitfields be an unsigned with explicit masks Pierre Habouzit
2007-11-07 10:20             ` [PATCH DIFF-CLEANUP 2/2] Reorder diff_opt_parse options more logically per topics Pierre Habouzit
2007-11-08  6:39             ` [PATCH DIFF-CLEANUP 1/2] Make the diff_options bitfields be an unsigned with explicit masks Junio C Hamano
2007-11-08  8:17               ` Pierre Habouzit
2007-11-10 19:05               ` [UPDATE " Pierre Habouzit
2007-11-08 23:59     ` [PATCH PARSEOPT 1/4] parse-options new features Junio C Hamano
2007-11-09  0:17       ` Pierre Habouzit
2007-11-08  1:52   ` [PATCH MISC 1/1] Make gcc warning about empty if body go away Junio C Hamano
2007-11-08  2:01   ` Junio C Hamano
2007-11-08  8:12     ` Pierre Habouzit
2007-11-08  8:41     ` Andreas Ericsson
2007-11-08 15:20       ` Jon Loeliger
2007-11-08 15:47         ` Andreas Ericsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1194430832-6224-1-git-send-email-madcoder@debian.org \
    --to=madcoder@debian.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).