git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: pi song <pi.songs@gmail.com>
To: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Cc: rene.scharfe@lsrfire.ath.cx
Subject: Re: [PATCH1/2] Libify blame
Date: Wed, 18 Mar 2009 16:59:07 +1100	[thread overview]
Message-ID: <1b29507a0903172259t348cb4d5n70f5b3003b1eeb00@mail.gmail.com> (raw)
In-Reply-To: <7vocvzmlqf.fsf@gitster.siamese.dyndns.org>

Don't you think we should rather split up into smaller files before
start reorganizing things?

Pi Song

On Wed, Mar 18, 2009 at 4:41 PM, Junio C Hamano <gitster@pobox.com> wrote:
> pi song <pi.songs@gmail.com> writes:
>
>> diff --git a/blame.h b/blame.h
>> new file mode 100644
>> index 0000000..72d1e2a
>> --- /dev/null
>> +++ b/blame.h
>> @@ -0,0 +1,166 @@
>> +/*
>> + * for storing stats. it can be used
>> + * across multiple blame operations
>> + */
>> +struct blame_stat {
>> +     int num_read_blob;
>> +     int num_get_patch;
>> +     int num_commits;
>> +};
>
> As I said in my previous message, I do not understand why this is not part
> of the super-scoreboard (now blame_info).
>
>> +#define PICKAXE_BLAME_MOVE           01
>> +#define PICKAXE_BLAME_COPY           02
>> +#define PICKAXE_BLAME_COPY_HARDER    04
>> +#define PICKAXE_BLAME_COPY_HARDEST   010
>> +
>> +#define BLAME_DEFAULT_MOVE_SCORE     20
>> +#define BLAME_DEFAULT_COPY_SCORE     40
>> +
>> +/* bits #0..7 in revision.h, #8..11 used for merge_bases() in commit.c */
>> +#define METAINFO_SHOWN               (1u<<12)
>> +#define MORE_THAN_ONE_PATH   (1u<<13)
>
> Do we need to expose all of these constants outside blame.c?  I think the
> library caller needs access to the first four above, but I tend to think
> the latter four are purely internal implementation detail that should be
> kept in blame.c.
>
>> +/* output formatting constants */
>> +#define OUTPUT_ANNOTATE_COMPAT  001
>> +#define OUTPUT_LONG_OBJECT_NAME 002
>> +#define OUTPUT_RAW_TIMESTAMP    004
>> +#define OUTPUT_PORCELAIN        010
>> +#define OUTPUT_SHOW_NAME        020
>> +#define OUTPUT_SHOW_NUMBER      040
>> +#define OUTPUT_SHOW_SCORE      0100
>> +#define OUTPUT_NO_AUTHOR       0200
>
> I think these can be public.
>
>> +/*
>> + * One blob in a commit that is being suspected
>> + */
>> +struct origin {
>> +     int refcnt;
>> +     struct origin *previous;
>> +     struct commit *commit;
>> +     mmfile_t file;
>> +     unsigned char blob_sha1[20];
>> +     char path[FLEX_ARRAY];
>> +};
>
> I somehow doubt we would want to expose this level of implementation
> detail to the callers of the library.  If we need to, the structure needs
> to be renamed---"origin" is way too generic a name.
>
>> +extern void assign_blame(struct blame_scoreboard *sb, int opt) ;
>
> Lose the extra SP before ";".  I had to fix them in your previous patch
> and there were many.
>

  reply	other threads:[~2009-03-18  6:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-16 13:25 [PATCH1/2] Libify blame pi song
2009-03-18  5:41 ` Junio C Hamano
2009-03-18  5:59   ` pi song [this message]
2009-03-18  6:20     ` Junio C Hamano
2009-03-18  6:52       ` pi song
2009-03-18  7:01         ` pi song

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=1b29507a0903172259t348cb4d5n70f5b3003b1eeb00@mail.gmail.com \
    --to=pi.songs@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=rene.scharfe@lsrfire.ath.cx \
    /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).