Thread (73 messages) 73 messages, 6 authors, 2023-05-02

Re: [PATCH v2 12/22] tree-diff.c: move S_DIFFTREE_IFXMIN_NEQ define from cache.h

From: Elijah Newren <hidden>
Date: 2023-05-02 01:07:45

On Mon, May 1, 2023 at 9:35 AM Ævar Arnfjörð Bjarmason [off-list ref] wrote:
On Sat, Apr 22 2023, Elijah Newren via GitGitGadget wrote:
[...]
quoted
--- a/tree-diff.c
+++ b/tree-diff.c
@@ -6,6 +6,19 @@
 #include "diffcore.h"
 #include "tree.h"

+/*
+ * Some mode bits are also used internally for computations.
+ *
+ * They *must* not overlap with any valid modes, and they *must* not be emitted
+ * to outside world - i.e. appear on disk or network. In other words, it's just
+ * temporary fields, which we internally use, but they have to stay in-house.
+ *
+ * ( such approach is valid, as standard S_IF* fits into 16 bits, and in Git
+ *   codebase mode is `unsigned int` which is assumed to be at least 32 bits )
+ */
+
+#define S_DIFFTREE_IFXMIN_NEQ        0x80000000
+
 /*
  * internal mode marker, saying a tree entry != entry of tp[imin]
  * (see ll_diff_tree_paths for what it means there)
As it's only used in tree-diff.c, should this change not be instead
changing how we define S_IFXMIN_NEQ itself, and combining the two
comments seen here (the latter only partially, in the context).

Not that this makes things worse or anything...
Hmm, that makes sense; I'll make the tweak.  Thanks for the suggestion.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help