git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Keith Cascio <keith@CS.UCLA.EDU>
Cc: Jeff King <peff@peff.net>, git@vger.kernel.org
Subject: Re: [PATCH v2 1/2] Introduce config variable "diff.primer"
Date: Tue, 03 Feb 2009 21:43:51 -0800	[thread overview]
Message-ID: <7v7i4692p4.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <alpine.GSO.2.00.0902030833250.5994@kiwi.cs.ucla.edu> (Keith Cascio's message of "Tue, 3 Feb 2009 09:55:08 -0800 (PST)")

Keith Cascio <keith@CS.UCLA.EDU> writes:

> I think introducing explicit dirty masks and explicit layer flattening is the 
> right way to go forward,...

I am not so sure about this claim.  I kind of like idea of "we know the
desirable value of this bit, do not touch it any further" mask, but I
think it is independent of flattening.  In fact, I do not think flattening
is a good thing.

Any codepath could call DIFF_OPT_SET()/CLR(), whether it is in response to
end user's input from the command line (e.g. "the user said --foo, so I am
flipping the foo bit on/off), or to enforce restriction to achieve sane
semantics (e.g. "it does not make any sense to run this internal diff
without --binary set, so I am using OPT_SET()").  Is it still true, or do
some bit flipping now need to be protected by "is it locked" check and
some others don't?

The latter one (i.e. in the above example, "this internal diff must run
with --binary") we may want to use "opts->mask" to lock down (I wouldn't
call it "dirty", it is more like "locked") the "binary" bit, and we may
even want to issue a warning or an error when the end user attempts to
countermand with --no-binary.  Similarly, I think you would want to lock
down what you got from the true command line so that you can leave them
untouched when you process the value you read from diff.primer.

Doesn't it suggest that you may want two layers of masks, not a flat one,
if you really want the mechanism to scale?

In any case, I think the mechanism based on the lock-down mask is worth
considering when we enhance the option parsing mechanism for the diff and
log family, and if it is done right, I think the code to parse revision
options would benefit quite a bit.  There are codepaths that initialize
the bits to the command's liking (e.g. show wants to always have diff),
let setup_revisions() to process command line flags, and then further
tweak the remaining bits (e.g. whatchanged wants to default to raw), all
interacting in quite subtle ways.

But that should probably be for later cycle, post 1.6.2.

  reply	other threads:[~2009-02-04  5:45 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1233598855-1088-1-git-send-email-keith@cs.ucla.edu>
2009-02-02 18:20 ` [PATCH v2 1/2] Introduce config variable "diff.primer" Keith Cascio
2009-02-02 18:20   ` [PATCH v2 2/2] Test functionality of new " Keith Cascio
2009-02-02 20:45     ` [PATCH v2 0/2] Introduce " Keith Cascio
2009-02-02 21:03   ` Keith Cascio
2009-02-03  7:15   ` [PATCH v2 1/2] " Jeff King
2009-02-03 17:55     ` Keith Cascio
2009-02-04  5:43       ` Junio C Hamano [this message]
2009-02-04  6:36         ` Keith Cascio
2009-02-06 16:54           ` Jeff King
2009-02-06 16:19       ` Jeff King
2009-02-07 21:45         ` Junio C Hamano
2009-02-09 17:24         ` Keith Cascio
2009-02-13 22:22           ` Jeff King
2009-02-14  6:03             ` Johannes Schindelin
2009-02-14  6:15               ` Jeff King
2009-02-14  6:24                 ` Johannes Schindelin
2009-02-14 15:17                   ` Jeff King
2009-02-15 23:26                   ` Keith Cascio
2009-02-15 23:39                     ` Junio C Hamano
2009-02-17  7:24             ` diff.defaultOptions implementation design [was diff.primer] Keith Cascio
2009-02-17 19:56               ` Jeff King
2009-03-17 16:05     ` [PATCH v2 1/2] Introduce config variable "diff.defaultOptions" Keith Cascio
2009-03-20  7:01       ` Jeff King
2009-03-20 17:11         ` Keith Cascio
2009-03-20 19:49           ` Jeff King
2009-03-21  2:00             ` [PATCH/RFC v3] Introduce config variable "diff.defaultoptions" Keith Cascio
2009-03-21  3:15               ` [PATCH] Allow setting default diff options via diff.defaultOptions Johannes Schindelin
2009-04-03  0:04                 ` Keith Cascio
2009-04-09  8:45                   ` Johannes Schindelin
2009-04-09  8:49                     ` Jeff King
2009-04-09 10:43                       ` Johannes Schindelin
2009-04-10  8:01                         ` Jeff King
2009-04-13 22:37                           ` [PATCH] Add the diff option --no-defaults Johannes Schindelin
2009-04-16  8:34                             ` Jeff King
2009-04-16  9:25                               ` Johannes Schindelin
2009-04-16  9:41                                 ` Jeff King
2009-04-16 16:52                                   ` Junio C Hamano
2009-04-16 17:36                                     ` Johannes Schindelin
2009-04-17 11:54                                     ` Jeff King
2009-04-17 13:15                                       ` Johannes Schindelin
2009-04-18 16:41                                         ` Keith Cascio
2009-04-18 17:40                                           ` Johannes Schindelin
2009-04-18 20:32                                             ` Keith Cascio
2009-04-18 21:15                                               ` Johannes Schindelin
2009-04-09 16:29                     ` [PATCH] Allow setting default diff options via diff.defaultOptions Keith Cascio
2009-04-09  0:44                 ` Keith Cascio
2009-04-09  8:29                   ` Johannes Schindelin
2009-04-09  8:31                   ` Jeff King
2009-02-03 18:56   ` [PATCH v2 1/2] Introduce config variable "diff.primer" Jakub Narebski
2009-02-03 19:13     ` Keith Cascio

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=7v7i4692p4.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=keith@CS.UCLA.EDU \
    --cc=peff@peff.net \
    /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).