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

Re: [PATCH v3 00/13] ci: include a Visual Studio build & test in our Azure Pipeline

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 6, 2019, 00:19 UTC
Message-ID
<xmqqimp26808.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<pull.288.v3.git.gitgitgadget@gmail.com>

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com> writes:

> Changes since v2:
>
>  * The overflow check introduced in v1 was consolidated into a single
>    helper.
Looks good to me.
Show 6 quoted lines
> Range-diff vs v2:
>
>   1:  4d0b38125a =  1:  4d0b38125a push: do not pretend to return `int` from `die_push_simple()`
>   2:  8800320590 <  -:  ---------- msvc: avoid using minus operator on unsigned types
>   -:  ---------- >  2:  7fe2a85506 msvc: avoid using minus operator on unsigned types
>   3:  8512a3e96d =  3:  e632a4eef4 winansi: use FLEX_ARRAY to avoid compiler warning
This is less useful than it could be.  

With a larger creation-factor (and we can afford using a larger one, simply because the user of GGG _knows_ that the two series being compared are closely related), what is output is entirely readable (attached at the end).

Oh, while I am suggesting possible improvements on GGG, can we please tweak the sender date like git-send-email does so that two messages in the same series do not share the same timestamp? When multi-patch series are displayed in MUA or public-inbox News feed out of order, it almost always is from GGG that gave the same timestamp to adjacent messages in a series, and it prevents me from applying them in one go (or saving in one action to a mbox).

What send-email does is, at the beginning for N patch series, to take the current wallclock time and subtract N seconds from it, and then give that timestamp to the first message it sends out, and after that, it increments the timestamp by 1 seconds.

Note that there is no need for any "sleep"---the timestamps are given by explicitly generating the "Date: " header. The last time we looked into this issue, I think the code was trying to do almost the right thing but it was giving a malformatted timezone and forcing the sending MTA to override it with the wallclock time or something.

Thanks.
1:  9629f3c751 ! 1:  c097b95a26 msvc: avoid using minus operator on unsigned types
    @@ Commit message
         Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
         Signed-off-by: Junio C Hamano <gitster@pobox.com>
     
    + ## cache.h ##
    +@@ cache.h: struct cache_entry *index_file_exists(struct index_state *istate, const char *na
    +  */
    + int index_name_pos(const struct index_state *, const char *name, int namelen);
    + 
    ++/*
    ++ * Some functions return the negative complement of an insert position when a
    ++ * precise match was not found but a position was found where the entry would
    ++ * need to be inserted. This helper protects that logic from any integer
    ++ * underflow.
    ++ */
    ++static inline int index_pos_to_insert_pos(uintmax_t pos)
    ++{
    ++	if (pos > INT_MAX)
    ++		die("overflow: -1 - %"PRIuMAX, pos);
    ++	return -1 - (int)pos;
    ++}
    ++
    + #define ADD_CACHE_OK_TO_ADD 1		/* Ok to add */
    + #define ADD_CACHE_OK_TO_REPLACE 2	/* Ok to replace file/directory */
    + #define ADD_CACHE_SKIP_DFCHECK 4	/* Ok to skip DF conflict checks */
    +
      ## read-cache.c ##
     @@ read-cache.c: static int add_index_entry_with_check(struct index_state *istate, struct cache_e
    - 	 * we can avoid searching for it.
      	 */
      	if (istate->cache_nr > 0 &&
    --		strcmp(ce->name, istate->cache[istate->cache_nr - 1]->name) > 0)
    + 		strcmp(ce->name, istate->cache[istate->cache_nr - 1]->name) > 0)
     -		pos = -istate->cache_nr - 1;
    -+		strcmp(ce->name, istate->cache[istate->cache_nr - 1]->name) > 0) {
    -+		if (istate->cache_nr > INT_MAX)
    -+			die("overflow: -1 - %u", istate->cache_nr);
    -+		pos = -1 - (int)istate->cache_nr;
    -+	}
    ++		pos = index_pos_to_insert_pos(istate->cache_nr);
      	else
      		pos = index_name_stage_pos(istate, ce->name, ce_namelen(ce), ce_stage(ce));
      
    @@ read-cache.c: static size_t estimate_cache_size(size_t ondisk_size, unsigned int
     
      ## sha1-lookup.c ##
     @@ sha1-lookup.c: int sha1_pos(const unsigned char *sha1, void *table, size_t nr,
    - 			miv = take2(sha1 + ofs);
      			if (miv < lov)
      				return -1;
    --			if (hiv < miv)
    + 			if (hiv < miv)
     -				return -1 - nr;
    -+			if (hiv < miv) {
    -+				if (nr > INT_MAX)
    -+					die("overflow: -1 - %"PRIuMAX,
    -+					    (uintmax_t)nr);
    -+				return -1 - (int)nr;
    -+			}
    ++				return index_pos_to_insert_pos(nr);
      			if (lov != hiv) {
      				/*
      				 * At this point miv could be equal
    @@ sha1-lookup.c: int sha1_pos(const unsigned char *sha1, void *table, size_t nr,
      		mi = lo + (hi - lo) / 2;
      	} while (lo < hi);
     -	return -lo-1;
    -+	if (nr > INT_MAX)
    -+		die("overflow: -1 - %"PRIuMAX, (uintmax_t)lo);
    -+	return -1 - (int)lo;
    ++	return index_pos_to_insert_pos(lo);
      }
      
      int bsearch_hash(const unsigned char *sha1, const uint32_t *fanout_nbo,
Previous: Johannes Schindelin via GitGitGadgetNext: Johannes Schindelin
Message 60 of 72 in “ci: include a Visual Studio build & test in our Azure Pipeline”
  1. 00/13 ci: include a Visual Studio build & test in our Azure PipelineJohannes Schindelin via GitGitGadget, Sep 26, 2019
  2. 01/13 push: do not pretend to return `int` from `die_push_simple()`Johannes Schindelin via GitGitGadget, Sep 26, 2019
  3. 02/13 msvc: avoid using minus operator on unsigned typesJohannes Schindelin via GitGitGadget, Sep 26, 2019
  4. Denton LiuSep 26, 2019
  5. Johannes SchindelinSep 26, 2019
  6. Denton LiuSep 26, 2019
  7. Johannes SchindelinSep 30, 2019
  8. 03/13 winansi: use FLEX_ARRAY to avoid compiler warningJohannes Schindelin via GitGitGadget, Sep 26, 2019
  9. 04/13 compat/win32/path-utils.h: add #include guardsJohannes Schindelin via GitGitGadget, Sep 26, 2019
  10. 05/13 msvc: ignore some libraries when linkingJohannes Schindelin via GitGitGadget, Sep 26, 2019
  11. 06/13 msvc: handle DEVELOPER=1Johannes Schindelin via GitGitGadget, Sep 26, 2019
  12. 07/13 msvc: work around a bug in GetEnvironmentVariable()Johannes Schindelin via GitGitGadget, Sep 26, 2019
  13. 08/13 vcxproj: only copy `git-remote-http.exe` once it was builtJohannes Schindelin via GitGitGadget, Sep 26, 2019
  14. 10/13 test-tool run-command: learn to run (parts of) the testsuiteJohannes Schindelin via GitGitGadget, Sep 26, 2019
  15. 09/13 vcxproj: include more generated filesJohannes Schindelin via GitGitGadget, Sep 26, 2019
  16. 11/13 tests: let --immediate and --write-junit-xml play well togetherJohannes Schindelin via GitGitGadget, Sep 26, 2019
  17. Junio C HamanoSep 28, 2019
  18. Johannes SchindelinSep 30, 2019
  19. 12/13 ci: really use shallow clones on Azure PipelinesJohannes Schindelin via GitGitGadget, Sep 26, 2019
  20. 13/13 ci: also build and test with MS Visual Studio on Azure PipelinesJohannes Schindelin via GitGitGadget, Sep 26, 2019
  21. 00/13 ci: include a Visual Studio build & test in our Azure PipelineJohannes Schindelin via GitGitGadget, Sep 30, 2019
  22. 01/13 push: do not pretend to return `int` from `die_push_simple()`Johannes Schindelin via GitGitGadget, Sep 30, 2019
  23. Junio C HamanoOct 3, 2019
  24. Johannes SchindelinOct 4, 2019
  25. 03/13 winansi: use FLEX_ARRAY to avoid compiler warningJohannes Schindelin via GitGitGadget, Sep 30, 2019
  26. 02/13 msvc: avoid using minus operator on unsigned typesJohannes Schindelin via GitGitGadget, Sep 30, 2019
  27. Junio C HamanoOct 3, 2019
  28. Johannes SchindelinOct 4, 2019
  29. Johannes SixtOct 4, 2019
  30. Johannes SchindelinOct 4, 2019
  31. Junio C HamanoOct 6, 2019
  32. Johannes SixtOct 6, 2019
  33. Johannes SchindelinOct 8, 2019
  34. Johannes SixtOct 8, 2019
  35. 05/13 msvc: ignore some libraries when linkingJohannes Schindelin via GitGitGadget, Sep 30, 2019
  36. 06/13 msvc: handle DEVELOPER=1Johannes Schindelin via GitGitGadget, Sep 30, 2019
  37. 04/13 compat/win32/path-utils.h: add #include guardsJohannes Schindelin via GitGitGadget, Sep 30, 2019
  38. 07/13 msvc: work around a bug in GetEnvironmentVariable()Johannes Schindelin via GitGitGadget, Sep 30, 2019
  39. 11/13 tests: let --immediate and --write-junit-xml play well togetherJohannes Schindelin via GitGitGadget, Sep 30, 2019
  40. 13/13 ci: also build and test with MS Visual Studio on Azure PipelinesJohannes Schindelin via GitGitGadget, Sep 30, 2019
  41. 10/13 test-tool run-command: learn to run (parts of) the testsuiteJohannes Schindelin via GitGitGadget, Sep 30, 2019
  42. 08/13 vcxproj: only copy `git-remote-http.exe` once it was builtJohannes Schindelin via GitGitGadget, Sep 30, 2019
  43. 09/13 vcxproj: include more generated filesJohannes Schindelin via GitGitGadget, Sep 30, 2019
  44. 12/13 ci: really use shallow clones on Azure PipelinesJohannes Schindelin via GitGitGadget, Sep 30, 2019
  45. 00/13 ci: include a Visual Studio build & test in our Azure PipelineJohannes Schindelin via GitGitGadget, Oct 4, 2019
  46. 01/13 push: do not pretend to return `int` from `die_push_simple()`Johannes Schindelin via GitGitGadget, Oct 4, 2019
  47. 03/13 winansi: use FLEX_ARRAY to avoid compiler warningJohannes Schindelin via GitGitGadget, Oct 4, 2019
  48. Alban GruinOct 7, 2019
  49. 05/13 msvc: ignore some libraries when linkingJohannes Schindelin via GitGitGadget, Oct 4, 2019
  50. 02/13 msvc: avoid using minus operator on unsigned typesJohannes Schindelin via GitGitGadget, Oct 4, 2019
  51. 08/13 vcxproj: only copy `git-remote-http.exe` once it was builtJohannes Schindelin via GitGitGadget, Oct 4, 2019
  52. 07/13 msvc: work around a bug in GetEnvironmentVariable()Johannes Schindelin via GitGitGadget, Oct 4, 2019
  53. 09/13 vcxproj: include more generated filesJohannes Schindelin via GitGitGadget, Oct 4, 2019
  54. 04/13 compat/win32/path-utils.h: add #include guardsJohannes Schindelin via GitGitGadget, Oct 4, 2019
  55. 12/13 ci: really use shallow clones on Azure PipelinesJohannes Schindelin via GitGitGadget, Oct 4, 2019
  56. 06/13 msvc: handle DEVELOPER=1Johannes Schindelin via GitGitGadget, Oct 4, 2019
  57. 11/13 tests: let --immediate and --write-junit-xml play well togetherJohannes Schindelin via GitGitGadget, Oct 4, 2019
  58. 10/13 test-tool run-command: learn to run (parts of) the testsuiteJohannes Schindelin via GitGitGadget, Oct 4, 2019
  59. 13/13 ci: also build and test with MS Visual Studio on Azure PipelinesJohannes Schindelin via GitGitGadget, Oct 4, 2019
  60. Junio C HamanoOct 6, 2019
  61. Johannes SchindelinOct 6, 2019
  62. Johannes SchindelinOct 6, 2019
  63. Junio C HamanoOct 7, 2019
  64. Johannes SchindelinOct 7, 2019
  65. Junio C HamanoOct 8, 2019
  66. Johannes SchindelinOct 8, 2019
  67. Philip OakleyOct 9, 2019
  68. Johannes SchindelinOct 10, 2019
  69. Philip OakleyOct 10, 2019
  70. Junio C HamanoOct 7, 2019
  71. Thomas GummererOct 7, 2019
  72. Johannes SchindelinOct 11, 2019

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.