git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/4] Resurrect "diff-lib.c: adjust position of i-t-a entries in diff"

From
Duy Nguyen <pclouds@gmail.com>
Date
Sep 27, 2016, 10:58 UTC
Message-ID
<CACsJy8A_CWgcS5za-Dha6Khgd6HqHk9UWHq7qqAeR-kns-syXg@mail.gmail.com>
In-Reply-To
<alpine.DEB.2.20.1606091815310.2680@virtualbox>
(sorry for a very late reply, I'm just picking this series up again)

On Thu, Jun 9, 2016 at 11:18 PM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:

Show 17 quoted lines
> Hi Duy,
>
> On Mon, 6 Jun 2016, Nguyễn Thái Ngọc Duy wrote:
>
>> diff --git a/diff.h b/diff.h
>> index b497078..9e42556 100644
>> --- a/diff.h
>> +++ b/diff.h
>> @@ -92,6 +92,7 @@ typedef struct strbuf *(*diff_prefix_fn_t)(struct diff_options *opt, void *data)
>>  #define DIFF_OPT_FUNCCONTEXT         (1 << 29)
>>  #define DIFF_OPT_PICKAXE_IGNORE_CASE (1 << 30)
>>  #define DIFF_OPT_DEFAULT_FOLLOW_RENAMES (1U << 31)
>> +#define DIFF_OPT_SHIFT_INTENT_TO_ADD (1UL << 32)
>
> I am afraid that this is not enough. On Windows, sizeof(unsigned long) is
> 4 (and it is perfectly legal). That means that you would have to use at
> least (1ULL << 32),
OK.
> but then you also have to change the type of xdl_opts
> to uint64_t, which in turn means that you will have to change the
> definition of xpparam_t's "flags" field from unsigned long to uint64_t.

I miss a connection here. This new flag is intended to be used in "flags" field in struct diff_options. Is there any chance it can be set on xdl_opts (of the same struct, I assume)?

> Maybe this can be avoided?

I don't see a good way to avoid it. We normally enable or disable diff features as bit flags and now we run out of bits. Adding something like "flags2" works, but not pretty. Any suggestion is welcome.

-- 
Duy
Previous: Johannes SchindelinNext: Duy Nguyen
Message 10 of 15 in “i-t-a entries again...”
  1. 0/4 i-t-a entries again...Nguyễn Thái Ngọc Duy, Jun 6, 2016
  2. 1/4 diff.h: extend "flags" field to 64 bits because we're out of bitsNguyễn Thái Ngọc Duy, Jun 6, 2016
  3. Junio C HamanoJun 6, 2016
  4. Duy NguyenJun 7, 2016
  5. stefan.naewe@atlas-elektronik.comJun 7, 2016
  6. 2/4 Resurrect "diff-lib.c: adjust position of i-t-a entries in diff"Nguyễn Thái Ngọc Duy, Jun 6, 2016
  7. Junio C HamanoJun 6, 2016
  8. Duy NguyenJun 7, 2016
  9. Johannes SchindelinJun 9, 2016
  10. Duy NguyenSep 27, 2016
  11. Duy NguyenSep 27, 2016
  12. 3/4 commit: don't count i-t-a entries when checking if the new commit is emptyNguyễn Thái Ngọc Duy, Jun 6, 2016
  13. Junio C HamanoJun 6, 2016
  14. Junio C HamanoJun 6, 2016
  15. 4/4 commit: reinstate commit behavior before 3f6d56d via a config optionNguyễn Thái Ngọc Duy, Jun 6, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.