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

[PATCH v5 5/5] rebase: teach rebase --keep-base

From
Denton Liu <liu.denton@gmail.com>
Date
Apr 15, 2019, 22:29 UTC
Message-ID
<d6e7e1ca4b8d9c644181adef6ab1e4be77722b99.1555366891.git.liu.denton@gmail.com>
In-Reply-To
<cover.1555366891.git.liu.denton@gmail.com>

A common scenario is if a user is working on a topic branch and they wish to make some changes to intermediate commits or autosquash, they would run something such as

	git rebase -i --onto master... master

in order to preserve the merge base. This is useful when contributing a patch series to the Git mailing list, one often starts on top of the current 'master'. However, while developing the patches, 'master' is also developed further and it is sometimes not the bst idea to keep rebasing on top of 'master', but to keep the base commit as-is.

Alternatively, a user wishing to test individual commits in a topic branch without changing anything may run

	git rebase -x ./test.sh master... master

Since rebasing onto the merge base of the branch and the upstream is such a common case, introduce the --keep-base option as a shortcut.

This allows us to rewrite the above as
	git rebase -i --keep-base master
and
	git rebase -x ./test.sh --keep-base master
respectively.

Add tests to ensure --keep-base works correctly in the normal case and fails when there are multiple merge bases, both in regular and interactive mode. Also, test to make sure conflicting options cause rebase to fail. While we're adding test cases, add a missing set_fake_editor call to 'rebase -i --onto master...side'.

While we're documenting the --keep-base option, change an instance of "merge-base" to "merge base", which is the consistent spelling.

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
 Documentation/git-rebase.txt     | 30 +++++++++++++++--
 builtin/rebase.c                 | 32 ++++++++++++++----
 t/t3416-rebase-onto-threedots.sh | 57 ++++++++++++++++++++++++++++++++
 t/t3431-rebase-fork-point.sh     |  4 +++
 t/t3432-rebase-fast-forward.sh   | 11 ++++++
 5 files changed, 125 insertions(+), 9 deletions(-)
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 6363d674b7..569ab708d4 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -8,8 +8,8 @@ git-rebase - Reapply commits on top of another base tip
 SYNOPSIS
 --------
 [verse]
-'git rebase' [-i | --interactive] [<options>] [--exec <cmd>] [--onto <newbase>]
-	[<upstream> [<branch>]]
+'git rebase' [-i | --interactive] [<options>] [--exec <cmd>]
+	[--onto <newbase> | --keep-base] [<upstream> [<branch>]]
 'git rebase' [-i | --interactive] [<options>] [--exec <cmd>] [--onto <newbase>]
 	--root [<branch>]
 'git rebase' --continue | --skip | --abort | --quit | --edit-todo | --show-current-patch
@@ -217,6 +217,24 @@ As a special case, you may use "A\...B" as a shortcut for the
 merge base of A and B if there is exactly one merge base. You can
 leave out at most one of A and B, in which case it defaults to HEAD.
 
+--keep-base::
+	Set the starting point at which to create the new commits to the
+	merge base of <upstream> <branch>. Running
+	'git rebase --keep-base <upstream> <branch>' is equivalent to
+	running 'git rebase --onto <upstream>... <upstream>'.
++
+This option is useful in the case where one is developing a feature on
+top of an upstream branch. While the feature is being worked on, the
+upstream branch may advance and it may not be the best idea to keep
+rebasing on top of the upstream but to keep the base commit as-is.
++
+Although both this option and --fork-point find the merge base between
+<upstream> and <branch>, this option uses the merge base as the _starting
+point_ on which new commits will be created, whereas --fork-point uses
+the merge base to determine the _set of commits_ which will be rebased.
++
+See also INCOMPATIBLE OPTIONS below.
+
 <upstream>::
 	Upstream branch to compare against.  May be any valid commit,
 	not just an existing branch name. Defaults to the configured
@@ -364,6 +382,10 @@ ends up being empty, the <upstream> will be used as a fallback.
 +
 If either <upstream> or --root is given on the command line, then the
 default is `--no-fork-point`, otherwise the default is `--fork-point`.
++
+If your branch was based on <upstream> but <upstream> was rewound and
+your branch contains commits which were dropped, this option can be used
+with `--keep-base` in order to drop those commits from your branch.
 
 --ignore-whitespace::
 --whitespace=<option>::
@@ -539,6 +561,8 @@ In addition, the following pairs of options are incompatible:
  * --preserve-merges and --rebase-merges
  * --rebase-merges and --strategy
  * --rebase-merges and --strategy-option
+ * --keep-base and --onto
+ * --keep-base and --root
 
 BEHAVIORAL DIFFERENCES
 -----------------------
@@ -863,7 +887,7 @@ NOTE: While an "easy case recovery" sometimes appears to be successful
       --interactive` will be **resurrected**!
 
 The idea is to manually tell 'git rebase' "where the old 'subsystem'
-ended and your 'topic' began", that is, what the old merge-base
+ended and your 'topic' began", that is, what the old merge base
 between them was.  You will have to find a way to name the last commit
 of the old 'subsystem', for example:
 
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 5f00d91b68..289763651e 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -27,8 +27,8 @@
 #include "branch.h"
 
 static char const * const builtin_rebase_usage[] = {
-	N_("git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] "
-		"[<upstream>] [<branch>]"),
+	N_("git rebase [-i] [options] [--exec <cmd>] "
+		"[--onto <newbase> | --keep-base] [<upstream> [<branch>]]"),
 	N_("git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] "
 		"--root [<branch>]"),
 	N_("git rebase --continue | --abort | --skip | --edit-todo"),
@@ -1039,6 +1039,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
 	};
 	const char *branch_name;
 	int ret, flags, total_argc, in_progress = 0;
+	int keep_base = 0;
 	int ok_to_skip_pre_rebase = 0;
 	struct strbuf msg = STRBUF_INIT;
 	struct strbuf revisions = STRBUF_INIT;
@@ -1072,6 +1073,8 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
 		OPT_STRING(0, "onto", &options.onto_name,
 			   N_("revision"),
 			   N_("rebase onto given branch instead of upstream")),
+		OPT_BOOL(0, "keep-base", &keep_base,
+			 N_("use the merge-base of upstream and branch as the current base")),
 		OPT_BOOL(0, "no-verify", &ok_to_skip_pre_rebase,
 			 N_("allow pre-rebase hook to run")),
 		OPT_NEGBIT('q', "quiet", &options.flags,
@@ -1238,6 +1241,13 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
 		usage_with_options(builtin_rebase_usage,
 				   builtin_rebase_options);
 
+	if (keep_base) {
+		if (options.onto_name)
+			die(_("cannot combine '--keep-base' with '--onto'"));
+		if (options.root)
+			die(_("cannot combine '--keep-base' with '--root'"));
+	}
+
 	if (action != NO_ACTION && !in_progress)
 		die(_("No rebase in progress?"));
 	setenv(GIT_REFLOG_ACTION_ENVIRONMENT, "rebase", 0);
@@ -1562,12 +1572,22 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
 	}
 
 	/* Make sure the branch to rebase onto is valid. */
-	if (!options.onto_name)
+	if (keep_base) {
+		strbuf_reset(&buf);
+		strbuf_addstr(&buf, options.upstream_name);
+		strbuf_addstr(&buf, "...");
+		options.onto_name = xstrdup(buf.buf);
+	} else if (!options.onto_name)
 		options.onto_name = options.upstream_name;
 	if (strstr(options.onto_name, "...")) {
-		if (get_oid_mb(options.onto_name, &merge_base) < 0)
-			die(_("'%s': need exactly one merge base"),
-			    options.onto_name);
+		if (get_oid_mb(options.onto_name, &merge_base) < 0) {
+			if (keep_base)
+				die(_("'%s': need exactly one merge base with branch"),
+				    options.upstream_name);
+			else
+				die(_("'%s': need exactly one merge base"),
+				    options.onto_name);
+		}
 		options.onto = lookup_commit_or_die(&merge_base,
 						    options.onto_name);
 	} else {
diff --git a/t/t3416-rebase-onto-threedots.sh b/t/t3416-rebase-onto-threedots.sh
index ddf2f64853..9c2548423b 100755
--- a/t/t3416-rebase-onto-threedots.sh
+++ b/t/t3416-rebase-onto-threedots.sh
@@ -99,7 +99,64 @@ test_expect_success 'rebase -i --onto master...side' '
 	git checkout side &&
 	git reset --hard K &&
 
+	set_fake_editor &&
 	test_must_fail git rebase -i --onto master...side J
 '
 
+test_expect_success 'rebase --keep-base --onto incompatible' '
+	test_must_fail git rebase --keep-base --onto master...
+'
+
+test_expect_success 'rebase --keep-base --root incompatible' '
+	test_must_fail git rebase --keep-base --root
+'
+
+test_expect_success 'rebase --keep-base master from topic' '
+	git reset --hard &&
+	git checkout topic &&
+	git reset --hard G &&
+
+	git rebase --keep-base master &&
+	git rev-parse C >base.expect &&
+	git merge-base master HEAD >base.actual &&
+	test_cmp base.expect base.actual &&
+
+	git rev-parse HEAD~2 >actual &&
+	git rev-parse C^0 >expect &&
+	test_cmp expect actual
+'
+
+test_expect_success 'rebase --keep-base master from side' '
+	git reset --hard &&
+	git checkout side &&
+	git reset --hard K &&
+
+	test_must_fail git rebase --keep-base master
+'
+
+test_expect_success 'rebase -i --keep-base master from topic' '
+	git reset --hard &&
+	git checkout topic &&
+	git reset --hard G &&
+
+	set_fake_editor &&
+	EXPECT_COUNT=2 git rebase -i --keep-base master &&
+	git rev-parse C >base.expect &&
+	git merge-base master HEAD >base.actual &&
+	test_cmp base.expect base.actual &&
+
+	git rev-parse HEAD~2 >actual &&
+	git rev-parse C^0 >expect &&
+	test_cmp expect actual
+'
+
+test_expect_success 'rebase -i --keep-base master from side' '
+	git reset --hard &&
+	git checkout side &&
+	git reset --hard K &&
+
+	set_fake_editor &&
+	test_must_fail git rebase -i --keep-base master
+'
+
 test_done
diff --git a/t/t3431-rebase-fork-point.sh b/t/t3431-rebase-fork-point.sh
index 6d523123d0..e63040932f 100755
--- a/t/t3431-rebase-fork-point.sh
+++ b/t/t3431-rebase-fork-point.sh
@@ -43,11 +43,15 @@ test_rebase() {
 
 test_rebase 'G F E D B A'
 test_rebase 'G F D B A' --onto D
+test_rebase 'G F B A' --keep-base
 test_rebase 'G F C E D B A' --no-fork-point
 test_rebase 'G F C D B A' --no-fork-point --onto D
+test_rebase 'G F C B A' --no-fork-point --keep-base
 test_rebase 'G F E D B A' --fork-point refs/heads/master
 test_rebase 'G F D B A' --fork-point --onto D refs/heads/master
+test_rebase 'G F B A' --fork-point --keep-base refs/heads/master
 test_rebase 'G F C E D B A' refs/heads/master
 test_rebase 'G F C D B A' --onto D refs/heads/master
+test_rebase 'G F C B A' --keep-base refs/heads/master
 
 test_done
diff --git a/t/t3432-rebase-fast-forward.sh b/t/t3432-rebase-fast-forward.sh
index 1cb2896fb4..1ba02cc95f 100755
--- a/t/t3432-rebase-fast-forward.sh
+++ b/t/t3432-rebase-fast-forward.sh
@@ -33,11 +33,15 @@ test_rebase_same_head success master
 test_rebase_same_head success --onto B B
 test_rebase_same_head success --onto B... B
 test_rebase_same_head success --onto master... master
+test_rebase_same_head success --keep-base master
+test_rebase_same_head success --keep-base
 test_rebase_same_head success --no-fork-point
+test_rebase_same_head success --keep-base --no-fork-point
 test_rebase_same_head success --fork-point master
 test_rebase_same_head success --fork-point --onto B B
 test_rebase_same_head success --fork-point --onto B... B
 test_rebase_same_head success --fork-point --onto master... master
+test_rebase_same_head success --fork-point --keep-base master
 
 test_expect_success 'add work to side' '
 	test_commit E
@@ -49,11 +53,15 @@ test_rebase_same_head success master
 test_rebase_same_head success --onto B B
 test_rebase_same_head success --onto B... B
 test_rebase_same_head success --onto master... master
+test_rebase_same_head success --keep-base master
+test_rebase_same_head success --keep-base
 test_rebase_same_head success --no-fork-point
+test_rebase_same_head success --keep-base --no-fork-point
 test_rebase_same_head success --fork-point master
 test_rebase_same_head success --fork-point --onto B B
 test_rebase_same_head success --fork-point --onto B... B
 test_rebase_same_head success --fork-point --onto master... master
+test_rebase_same_head success --fork-point --keep-base master
 
 test_expect_success 'add work to upstream' '
 	git checkout master &&
@@ -65,8 +73,11 @@ changes='our and their changes'
 test_rebase_same_head success --onto B B
 test_rebase_same_head success --onto B... B
 test_rebase_same_head success --onto master... master
+test_rebase_same_head success --keep-base master
+test_rebase_same_head success --keep-base
 test_rebase_same_head success --fork-point --onto B B
 test_rebase_same_head success --fork-point --onto B... B
 test_rebase_same_head success --fork-point --onto master... master
+test_rebase_same_head success --fork-point --keep-base master
 
 test_done
-- 
2.21.0.921.gb27c68c4e9
Previous: Denton LiuNext: Denton Liu
Message 60 of 123 in “rebase: learn --keep-base”
  1. 0/3 rebase: learn --keep-baseDenton Liu, Mar 23, 2019
  2. 1/3 rebase: teach rebase --keep-baseDenton Liu, Mar 23, 2019
  3. Eric SunshineMar 24, 2019
  4. Junio C HamanoMar 24, 2019
  5. Denton LiuMar 25, 2019
  6. Denton LiuMar 25, 2019
  7. Junio C HamanoApr 1, 2019
  8. Junio C HamanoMar 24, 2019
  9. Denton LiuMar 25, 2019
  10. Johannes SchindelinMar 25, 2019
  11. Denton LiuMar 25, 2019
  12. Johannes SchindelinMar 26, 2019
  13. 2/3 t3416: test rebase --keep-baseDenton Liu, Mar 23, 2019
  14. 3/3 git-rebase.txt: document --keep-base optionDenton Liu, Mar 23, 2019
  15. Junio C HamanoMar 24, 2019
  16. Denton LiuMar 25, 2019
  17. Junio C HamanoApr 1, 2019
  18. Ævar Arnfjörð BjarmasonMar 26, 2019
  19. Denton LiuMar 26, 2019
  20. Ævar Arnfjörð BjarmasonMar 26, 2019
  21. Denton LiuMar 26, 2019
  22. Ævar Arnfjörð BjarmasonMar 27, 2019
  23. rebase: teach rebase --keep-baseDenton Liu, Mar 28, 2019
  24. Ævar Arnfjörð BjarmasonMar 28, 2019
  25. Johannes SchindelinMar 29, 2019
  26. Denton LiuMar 29, 2019
  27. Junio C HamanoApr 1, 2019
  28. 0/4 rebase: teach rebase --keep-baseDenton Liu, Apr 1, 2019
  29. 1/4 t3431: add rebase --fork-point testsDenton Liu, Apr 1, 2019
  30. Denton LiuApr 4, 2019
  31. SZEDER GáborApr 5, 2019
  32. Junio C HamanoApr 8, 2019
  33. Johannes SchindelinApr 5, 2019
  34. Denton LiuApr 5, 2019
  35. Johannes SixtApr 5, 2019
  36. Johannes SchindelinApr 5, 2019
  37. Johannes SchindelinApr 5, 2019
  38. SZEDER GáborApr 5, 2019
  39. 2/4 t3432: test rebase fast-forward behaviorDenton Liu, Apr 1, 2019
  40. 3/4 rebase: fast-forward --onto in more casesDenton Liu, Apr 1, 2019
  41. Junio C HamanoApr 2, 2019
  42. Junio C HamanoApr 2, 2019
  43. Denton LiuApr 2, 2019
  44. 4/4 rebase: teach rebase --keep-baseDenton Liu, Apr 1, 2019
  45. 0/4 rebase: teach rebase --keep-baseDenton Liu, Apr 5, 2019
  46. 1/4 t3431: add rebase --fork-point testsDenton Liu, Apr 5, 2019
  47. 2/4 t3432: test rebase fast-forward behaviorDenton Liu, Apr 5, 2019
  48. 4/4 rebase: teach rebase --keep-baseDenton Liu, Apr 5, 2019
  49. 3/4 rebase: fast-forward --onto in more casesDenton Liu, Apr 5, 2019
  50. 0/5 rebase: teach rebase --keep-baseDenton Liu, Apr 15, 2019
  51. 1/5 t3431: add rebase --fork-point testsDenton Liu, Apr 15, 2019
  52. 2/5 t3432: test rebase fast-forward behaviorDenton Liu, Apr 15, 2019
  53. 3/5 rebase: fast-forward --onto in more casesDenton Liu, Apr 15, 2019
  54. Junio C HamanoApr 16, 2019
  55. Phillip WoodApr 16, 2019
  56. Denton LiuApr 17, 2019
  57. Phillip WoodApr 17, 2019
  58. Denton LiuApr 19, 2019
  59. 4/5 rebase: fast-forward --fork-point in more casesDenton Liu, Apr 15, 2019
  60. 5/5 rebase: teach rebase --keep-baseDenton Liu, Apr 15, 2019
  61. 0/5 rebase: teach rebase --keep-baseDenton Liu, Apr 17, 2019
  62. 1/6 t3431: add rebase --fork-point testsDenton Liu, Apr 17, 2019
  63. 2/6 t3432: test rebase fast-forward behaviorDenton Liu, Apr 17, 2019
  64. 3/6 rebase: refactor can_fast_forward into goto towerDenton Liu, Apr 17, 2019
  65. 4/6 rebase: fast-forward --onto in more casesDenton Liu, Apr 17, 2019
  66. Phillip WoodApr 17, 2019
  67. 5/6 rebase: fast-forward --fork-point in more casesDenton Liu, Apr 17, 2019
  68. 6/6 rebase: teach rebase --keep-baseDenton Liu, Apr 17, 2019
  69. 0/6 rebase: learn --keep-baseDenton Liu, Apr 21, 2019
  70. 1/6 t3431: add rebase --fork-point testsDenton Liu, Apr 21, 2019
  71. Denton LiuApr 23, 2019
  72. 2/6 t3432: test rebase fast-forward behaviorDenton Liu, Apr 21, 2019
  73. 3/6 rebase: refactor can_fast_forward into goto towerDenton Liu, Apr 21, 2019
  74. 4/6 rebase: fast-forward --onto in more casesDenton Liu, Apr 21, 2019
  75. 5/6 rebase: fast-forward --fork-point in more casesDenton Liu, Apr 21, 2019
  76. 6/6 rebase: teach rebase --keep-baseDenton Liu, Apr 21, 2019
  77. 00/13 learn --keep-base & moreÆvar Arnfjörð Bjarmason, May 8, 2019
  78. Junio C HamanoMay 8, 2019
  79. Junio C HamanoJul 19, 2019
  80. Denton LiuJul 19, 2019
  81. 0/9 rebase: learn --keep-base and improvements on fast-forward behaviourDenton Liu, Aug 25, 2019
  82. 1/9 t3431: add rebase --fork-point testsDenton Liu, Aug 25, 2019
  83. 3/9 t3432: distinguish "noop-same" v.s. "work-same" in "same head" testsDenton Liu, Aug 25, 2019
  84. 2/9 t3432: test rebase fast-forward behaviorDenton Liu, Aug 25, 2019
  85. 4/9 t3432: test for --no-ff's interaction with fast-forwardDenton Liu, Aug 25, 2019
  86. 5/9 rebase: refactor can_fast_forward into goto towerDenton Liu, Aug 25, 2019
  87. Pratyush YadavAug 25, 2019
  88. Denton LiuAug 26, 2019
  89. 6/9 rebase: fast-forward --onto in more casesDenton Liu, Aug 25, 2019
  90. 7/9 rebase: fast-forward --fork-point in more casesDenton Liu, Aug 25, 2019
  91. 8/9 rebase tests: test linear branch topologyDenton Liu, Aug 25, 2019
  92. 9/9 rebase: teach rebase --keep-baseDenton Liu, Aug 25, 2019
  93. Philip OakleyAug 25, 2019
  94. Junio C HamanoAug 26, 2019
  95. 0/9 rebase: learn --keep-base and improvements on fast-forward behaviourDenton Liu, Aug 27, 2019
  96. 1/9 t3431: add rebase --fork-point testsDenton Liu, Aug 27, 2019
  97. 2/9 t3432: test rebase fast-forward behaviorDenton Liu, Aug 27, 2019
  98. 3/9 t3432: distinguish "noop-same" v.s. "work-same" in "same head" testsDenton Liu, Aug 27, 2019
  99. 4/9 t3432: test for --no-ff's interaction with fast-forwardDenton Liu, Aug 27, 2019
  100. SZEDER GáborAug 27, 2019
  101. 5/9 rebase: refactor can_fast_forward into goto towerDenton Liu, Aug 27, 2019
  102. 6/9 rebase: fast-forward --onto in more casesDenton Liu, Aug 27, 2019
  103. 7/9 rebase: fast-forward --fork-point in more casesDenton Liu, Aug 27, 2019
  104. 8/9 rebase tests: test linear branch topologyDenton Liu, Aug 27, 2019
  105. 9/9 rebase: teach rebase --keep-baseDenton Liu, Aug 27, 2019
  106. 01/13 t3431: add rebase --fork-point testsÆvar Arnfjörð Bjarmason, May 8, 2019
  107. 02/13 t3432: test rebase fast-forward behaviorÆvar Arnfjörð Bjarmason, May 8, 2019
  108. 03/13 t3432: distinguish "noop-same" v.s. "work-same" in "same head" testsÆvar Arnfjörð Bjarmason, May 8, 2019
  109. 04/13 t3432: test for --no-ff's interaction with fast-forwardÆvar Arnfjörð Bjarmason, May 8, 2019
  110. 05/13 rebase: refactor can_fast_forward into goto towerÆvar Arnfjörð Bjarmason, May 8, 2019
  111. 06/13 rebase: fast-forward --onto in more casesÆvar Arnfjörð Bjarmason, May 8, 2019
  112. 07/13 rebase: fast-forward --fork-point in more casesÆvar Arnfjörð Bjarmason, May 8, 2019
  113. 09/13 rebase tests: test linear branch topologyÆvar Arnfjörð Bjarmason, May 8, 2019
  114. 08/13 rebase: teach rebase --keep-baseÆvar Arnfjörð Bjarmason, May 8, 2019
  115. 10/13 rebase: don't rebase linear topology with --fork-pointÆvar Arnfjörð Bjarmason, May 8, 2019
  116. 11/13 rebase: eliminate side-effects from can_fast_forward()Ævar Arnfjörð Bjarmason, May 8, 2019
  117. Johannes SchindelinMay 17, 2019
  118. 12/13 rebase: add a should_fast_forward() utility functionÆvar Arnfjörð Bjarmason, May 8, 2019
  119. 13/13 WIP: can_fast_forward() support for --preserve-merges and --rebase-mergesÆvar Arnfjörð Bjarmason, May 8, 2019
  120. Johannes SchindelinMay 17, 2019
  121. Ævar Arnfjörð BjarmasonApr 6, 2019
  122. Denton LiuApr 6, 2019
  123. Ævar Arnfjörð BjarmasonApr 13, 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.