git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Hariom Verma via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Hariom Verma <hariom18599@gmail.com>, Junio C Hamano <gitster@pobox.com>
Subject: [PATCH v2 0/1] builtin/blame.c: bit field constants into bit shift format
Date: Thu, 17 Oct 2019 17:46:50 +0000	[thread overview]
Message-ID: <pull.382.v2.git.1571334411.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.382.git.1571250635.gitgitgadget@gmail.com>

we are looking at bitfield constants, and elsewhere in the Git source code,
such cases are handled via bit shift operators rather than octal numbers,
which also makes it easier to spot holes in the range (if, say, 1<<5 was
missing, it is easier to spot it between 1<<4 and 1<<6 than it is to spot a
missing 040 between a 020 and a 0100). Also, bit shifts lead to low-level
optimizations because they require fewer calculations for the CPU. 

Special Thanks to @dscho for helping me out throughout the process.

Hariom Verma (1):
  builtin/blame.c: constants into bit shift format

 builtin/blame.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)


base-commit: 08da6496b61341ec45eac36afcc8f94242763468
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-382%2Fharry-hov%2Fenum-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-382/harry-hov/enum-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/382

Range-diff vs v1:

 1:  3b4b8e0353 ! 1:  838478a185 builtin/blame.c: constants into bit shift format
     @@ -29,18 +29,18 @@
      -#define OUTPUT_LINE_PORCELAIN	01000
      -#define OUTPUT_COLOR_LINE	02000
      -#define OUTPUT_SHOW_AGE_WITH_COLOR	04000
     -+#define OUTPUT_ANNOTATE_COMPAT      (1<<0)
     -+#define OUTPUT_LONG_OBJECT_NAME     (1<<1)
     -+#define OUTPUT_RAW_TIMESTAMP        (1<<2)
     -+#define OUTPUT_PORCELAIN            (1<<3)
     -+#define OUTPUT_SHOW_NAME            (1<<4)
     -+#define OUTPUT_SHOW_NUMBER          (1<<5)
     -+#define OUTPUT_SHOW_SCORE           (1<<6)
     -+#define OUTPUT_NO_AUTHOR            (1<<7)
     -+#define OUTPUT_SHOW_EMAIL           (1<<8)
     -+#define OUTPUT_LINE_PORCELAIN       (1<<9)
     -+#define OUTPUT_COLOR_LINE           (1<<10)
     -+#define OUTPUT_SHOW_AGE_WITH_COLOR  (1<<11)
     ++#define OUTPUT_ANNOTATE_COMPAT      (1U<<0)
     ++#define OUTPUT_LONG_OBJECT_NAME     (1U<<1)
     ++#define OUTPUT_RAW_TIMESTAMP        (1U<<2)
     ++#define OUTPUT_PORCELAIN            (1U<<3)
     ++#define OUTPUT_SHOW_NAME            (1U<<4)
     ++#define OUTPUT_SHOW_NUMBER          (1U<<5)
     ++#define OUTPUT_SHOW_SCORE           (1U<<6)
     ++#define OUTPUT_NO_AUTHOR            (1U<<7)
     ++#define OUTPUT_SHOW_EMAIL           (1U<<8)
     ++#define OUTPUT_LINE_PORCELAIN       (1U<<9)
     ++#define OUTPUT_COLOR_LINE           (1U<<10)
     ++#define OUTPUT_SHOW_AGE_WITH_COLOR  (1U<<11)
       
       static void emit_porcelain_details(struct blame_origin *suspect, int repeat)
       {

-- 
gitgitgadget

  parent reply	other threads:[~2019-10-17 17:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-16 18:30 [PATCH 0/1] builtin/blame.c: bit field constants into bit shift format Hariom Verma via GitGitGadget
2019-10-16 18:30 ` [PATCH 1/1] builtin/blame.c: " Hariom Verma via GitGitGadget
2019-10-16 19:10   ` Pratyush Yadav
2019-10-16 19:37     ` Jonathan Tan
2019-10-16 19:44       ` Pratyush Yadav
2019-10-17  7:38   ` Junio C Hamano
2019-10-17  7:33 ` [PATCH 0/1] builtin/blame.c: bit field " Junio C Hamano
2019-10-17 17:46 ` Hariom Verma via GitGitGadget [this message]
2019-10-17 17:46   ` [PATCH v2 1/1] builtin/blame.c: " Hariom Verma via GitGitGadget

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=pull.382.v2.git.1571334411.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hariom18599@gmail.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).