All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Han-Wen Nienhuys via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Han-Wen Nienhuys <hanwenn@gmail.com>,
	Han-Wen Nienhuys <hanwen@google.com>
Subject: Re: [PATCH] refs.h: make all flags arguments unsigned
Date: Mon, 31 Jan 2022 18:02:50 -0800	[thread overview]
Message-ID: <xmqqa6fbgx85.fsf@gitster.g> (raw)
In-Reply-To: pull.1210.git.git.1643660136530.gitgitgadget@gmail.com

"Han-Wen Nienhuys via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Han-Wen Nienhuys <hanwen@google.com>
>
> As discussed in
> https://lore.kernel.org/git/xmqqbkzrkevo.fsf@gitster.g/ , we don't
> want to treat the sign bit specially, so make all flags in refs.h
> unsigned.

It may be true that we do not want to, but are we sure there is no
code that already uses some cleverness to make the topmost bit
special by e.g. doing ugly things like "if (flags < 0)" ;-)?

IOW, what we want or do not want does not matter as much as what the
code paths that use these declarations want to do (and we need to fix
them before we can do this conversion).

I haven't had energy to vet the entire codebase for all flag words
and that is why I've never produced a patch like this one myself.

Thanks for carefully vetting after creating this (presumably
mechanically prepared) patch---producing is the easy part, but
making sure it does not break unexpectedly is much harder.

Somebody other than the author needs to double check the result,
though.

Thanks.

>  bisect.c                    |  4 +--
>  builtin/bisect--helper.c    |  7 ++---
>  builtin/branch.c            |  4 +--
>  builtin/checkout.c          |  9 ++++---
>  builtin/describe.c          |  3 ++-
>  builtin/fetch.c             | 10 +++----
>  builtin/fsck.c              |  4 +--
>  builtin/gc.c                |  5 ++--
>  builtin/name-rev.c          |  3 ++-
>  builtin/pack-objects.c      | 11 ++++----
>  builtin/rebase.c            |  5 ++--
>  builtin/receive-pack.c      |  4 +--
>  builtin/reflog.c            |  5 ++--
>  builtin/remote.c            | 13 ++++++----
>  builtin/repack.c            |  4 +--
>  builtin/replace.c           |  4 +--
>  builtin/rev-parse.c         |  6 +++--
>  builtin/show-branch.c       |  6 ++---
>  builtin/show-ref.c          |  4 +--
>  builtin/stash.c             |  2 +-
>  builtin/submodule--helper.c |  4 +--
>  builtin/symbolic-ref.c      |  2 +-
>  bundle.c                    |  2 +-
>  commit-graph.c              |  5 ++--
>  config.c                    |  2 +-
>  delta-islands.c             |  2 +-
>  fetch-pack.c                |  7 ++---
>  help.c                      |  2 +-
>  http-backend.c              |  4 +--
>  log-tree.c                  |  4 +--
>  ls-refs.c                   |  4 +--
>  midx.c                      |  5 ++--
>  negotiator/default.c        |  2 +-
>  negotiator/skipping.c       |  2 +-
>  notes.c                     |  5 ++--
>  object-name.c               |  2 +-
>  reachable.c                 |  2 +-
>  ref-filter.c                |  3 ++-
>  refs.c                      | 52 ++++++++++++++++++-------------------
>  refs.h                      | 38 ++++++++++++---------------
>  refs/files-backend.c        | 17 ++++++------
>  remote.c                    | 10 +++----
>  replace-object.c            |  7 +++--
>  revision.c                  |  8 +++---
>  server-info.c               |  2 +-
>  shallow.c                   |  4 +--
>  submodule.c                 |  4 +--
>  t/helper/test-ref-store.c   |  4 +--
>  transport-helper.c          |  2 +-
>  transport.c                 |  2 +-
>  upload-pack.c               |  8 +++---
>  walker.c                    |  2 +-
>  worktree.c                  |  6 ++---
>  53 files changed, 171 insertions(+), 167 deletions(-)

  reply	other threads:[~2022-02-01  2:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-31 20:15 [PATCH] refs.h: make all flags arguments unsigned Han-Wen Nienhuys via GitGitGadget
2022-02-01  2:02 ` Junio C Hamano [this message]
2022-02-01 11:47   ` Han-Wen Nienhuys
2022-02-01 18:41     ` Junio C Hamano
2022-02-01 12:46 ` [PATCH v2] " Han-Wen Nienhuys via GitGitGadget
2022-02-01 20:20   ` Ævar Arnfjörð Bjarmason
2022-02-01 23:03     ` Junio C Hamano
2022-02-03 14:29       ` Han-Wen Nienhuys
2022-02-03 17:53         ` Ævar Arnfjörð Bjarmason
2022-02-03 18:16           ` Han-Wen Nienhuys
2022-02-03 21:20             ` Ævar Arnfjörð Bjarmason
2022-02-03 18:27           ` Junio C Hamano
2022-02-03 18:33             ` Han-Wen Nienhuys
2022-02-03 19:15               ` Junio C Hamano
2022-02-03 14:26   ` [PATCH v3 0/2] " Han-Wen Nienhuys via GitGitGadget
2022-02-03 14:26     ` [PATCH v3 1/2] " Han-Wen Nienhuys via GitGitGadget
2022-02-03 14:26     ` [PATCH v3 2/2] Uniformize flag argument naming to `flags` or `unused_flags` Han-Wen Nienhuys 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=xmqqa6fbgx85.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=hanwen@google.com \
    --cc=hanwenn@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.