Skip to content

Commit 8679577

Browse files
harry-hovgitster
authored andcommitted
builtin/blame.c: constants into bit shift format
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). Signed-off-by: Hariom Verma <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5fa0f52 commit 8679577

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

builtin/blame.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -320,18 +320,18 @@ static const char *format_time(timestamp_t time, const char *tz_str,
320320
return time_buf.buf;
321321
}
322322

323-
#define OUTPUT_ANNOTATE_COMPAT 001
324-
#define OUTPUT_LONG_OBJECT_NAME 002
325-
#define OUTPUT_RAW_TIMESTAMP 004
326-
#define OUTPUT_PORCELAIN 010
327-
#define OUTPUT_SHOW_NAME 020
328-
#define OUTPUT_SHOW_NUMBER 040
329-
#define OUTPUT_SHOW_SCORE 0100
330-
#define OUTPUT_NO_AUTHOR 0200
331-
#define OUTPUT_SHOW_EMAIL 0400
332-
#define OUTPUT_LINE_PORCELAIN 01000
333-
#define OUTPUT_COLOR_LINE 02000
334-
#define OUTPUT_SHOW_AGE_WITH_COLOR 04000
323+
#define OUTPUT_ANNOTATE_COMPAT (1U<<0)
324+
#define OUTPUT_LONG_OBJECT_NAME (1U<<1)
325+
#define OUTPUT_RAW_TIMESTAMP (1U<<2)
326+
#define OUTPUT_PORCELAIN (1U<<3)
327+
#define OUTPUT_SHOW_NAME (1U<<4)
328+
#define OUTPUT_SHOW_NUMBER (1U<<5)
329+
#define OUTPUT_SHOW_SCORE (1U<<6)
330+
#define OUTPUT_NO_AUTHOR (1U<<7)
331+
#define OUTPUT_SHOW_EMAIL (1U<<8)
332+
#define OUTPUT_LINE_PORCELAIN (1U<<9)
333+
#define OUTPUT_COLOR_LINE (1U<<10)
334+
#define OUTPUT_SHOW_AGE_WITH_COLOR (1U<<11)
335335

336336
static void emit_porcelain_details(struct blame_origin *suspect, int repeat)
337337
{

0 commit comments

Comments
 (0)