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

[PATCH] [PoC] A simpler find_unique_prefixes() implementation

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Aug 28, 2019, 16:34 UTC
Message-ID
<20190828163419.30620-1-szeder.dev@gmail.com>
In-Reply-To
<20190828163045.GF8571@szeder.dev>

Implement find_unique_prefixes() by sorting the prefix items lexicographically and then looking for unique prefixes in adjacent pairs. It's definitely shorter than the current hashmap-based implementation (101 vs 149 lines), subjectively easier to follow, and hopefully less buggy (some of the new elements in the test trigger failure with the hashmap).

TODO: deal multi-byte caracter sequences, make the test tool more
      developer-friendly
---
 Makefile                   |   2 +-
 add-interactive.c          |   2 +-
 prefix-map.c               | 109 -------------------------------------
 prefix-map.h               |  40 --------------
 t/helper/test-prefix-map.c |  31 +++++++----
 unique-prefix.c            |  73 +++++++++++++++++++++++++
 unique-prefix.h            |  28 ++++++++++
 7 files changed, 124 insertions(+), 161 deletions(-)
 delete mode 100644 prefix-map.c
 delete mode 100644 prefix-map.h
 create mode 100644 unique-prefix.c
 create mode 100644 unique-prefix.h
diff --git a/Makefile b/Makefile
index 545a0e8743..6773041f0d 100644
--- a/Makefile
+++ b/Makefile
@@ -944,7 +944,6 @@ LIB_OBJS += patch-ids.o
 LIB_OBJS += path.o
 LIB_OBJS += pathspec.o
 LIB_OBJS += pkt-line.o
-LIB_OBJS += prefix-map.o
 LIB_OBJS += preload-index.o
 LIB_OBJS += pretty.o
 LIB_OBJS += prio-queue.o
@@ -1013,6 +1012,7 @@ LIB_OBJS += transport-helper.o
 LIB_OBJS += tree-diff.o
 LIB_OBJS += tree.o
 LIB_OBJS += tree-walk.o
+LIB_OBJS += unique-prefix.o
 LIB_OBJS += unpack-trees.o
 LIB_OBJS += upload-pack.o
 LIB_OBJS += url.o
diff --git a/add-interactive.c b/add-interactive.c
index c431c72e3f..cf22749b81 100644
--- a/add-interactive.c
+++ b/add-interactive.c
@@ -5,7 +5,7 @@
 #include "diffcore.h"
 #include "revision.h"
 #include "refs.h"
-#include "prefix-map.h"
+#include "unique-prefix.h"
 
 struct add_i_state {
 	struct repository *r;
diff --git a/prefix-map.c b/prefix-map.c
deleted file mode 100644
index 747ddb4ebc..0000000000
--- a/prefix-map.c
+++ /dev/null
@@ -1,109 +0,0 @@
-#include "cache.h"
-#include "prefix-map.h"
-
-static int map_cmp(const void *unused_cmp_data,
-		   const void *entry,
-		   const void *entry_or_key,
-		   const void *unused_keydata)
-{
-	const struct prefix_map_entry *a = entry;
-	const struct prefix_map_entry *b = entry_or_key;
-
-	return a->prefix_length != b->prefix_length ||
-		strncmp(a->name, b->name, a->prefix_length);
-}
-
-static void add_prefix_entry(struct hashmap *map, const char *name,
-			     size_t prefix_length, struct prefix_item *item)
-{
-	struct prefix_map_entry *result = xmalloc(sizeof(*result));
-	result->name = name;
-	result->prefix_length = prefix_length;
-	result->item = item;
-	hashmap_entry_init(result, memhash(name, prefix_length));
-	hashmap_add(map, result);
-}
-
-static void init_prefix_map(struct prefix_map *prefix_map,
-			    int min_prefix_length, int max_prefix_length)
-{
-	hashmap_init(&prefix_map->map, map_cmp, NULL, 0);
-	prefix_map->min_length = min_prefix_length;
-	prefix_map->max_length = max_prefix_length;
-}
-
-static void add_prefix_item(struct prefix_map *prefix_map,
-			    struct prefix_item *item)
-{
-	struct prefix_map_entry e = { { NULL } }, *e2;
-	int j;
-
-	e.item = item;
-	e.name = item->name;
-
-	for (j = prefix_map->min_length;
-	     j <= prefix_map->max_length && e.name[j]; j++) {
-		/* Avoid breaking UTF-8 multi-byte sequences */
-		if (!isascii(e.name[j]))
-			break;
-
-		e.prefix_length = j;
-		hashmap_entry_init(&e, memhash(e.name, j));
-		e2 = hashmap_get(&prefix_map->map, &e, NULL);
-		if (!e2) {
-			/* prefix is unique at this stage */
-			item->prefix_length = j;
-			add_prefix_entry(&prefix_map->map, e.name, j, item);
-			break;
-		}
-
-		if (!e2->item)
-			continue; /* non-unique prefix */
-
-		if (j != e2->item->prefix_length || memcmp(e.name, e2->name, j))
-			BUG("unexpected prefix length: %d != %d (%s != %s)",
-			    j, (int)e2->item->prefix_length, e.name, e2->name);
-
-		/* skip common prefix */
-		for (; j < prefix_map->max_length && e.name[j]; j++) {
-			if (e.item->name[j] != e2->item->name[j])
-				break;
-			add_prefix_entry(&prefix_map->map, e.name, j + 1,
-					 NULL);
-		}
-
-		/* e2 no longer refers to a unique prefix */
-		if (j < prefix_map->max_length && e2->name[j]) {
-			/* found a new unique prefix for e2's item */
-			e2->item->prefix_length = j + 1;
-			add_prefix_entry(&prefix_map->map, e2->name, j + 1,
-					 e2->item);
-		}
-		else
-			e2->item->prefix_length = 0;
-		e2->item = NULL;
-
-		if (j < prefix_map->max_length && e.name[j]) {
-			/* found a unique prefix for the item */
-			e.item->prefix_length = j + 1;
-			add_prefix_entry(&prefix_map->map, e.name, j + 1,
-					 e.item);
-		} else
-			/* item has no (short enough) unique prefix */
-			e.item->prefix_length = 0;
-
-		break;
-	}
-}
-
-void find_unique_prefixes(struct prefix_item **list, size_t nr,
-			  int min_length, int max_length)
-{
-	int i;
-	struct prefix_map prefix_map;
-
-	init_prefix_map(&prefix_map, min_length, max_length);
-	for (i = 0; i < nr; i++)
-		add_prefix_item(&prefix_map, list[i]);
-	hashmap_free(&prefix_map.map, 1);
-}
diff --git a/prefix-map.h b/prefix-map.h
deleted file mode 100644
index ce3b8a4a32..0000000000
--- a/prefix-map.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef PREFIX_MAP_H
-#define PREFIX_MAP_H
-
-#include "hashmap.h"
-
-struct prefix_item {
-	const char *name;
-	size_t prefix_length;
-};
-
-struct prefix_map_entry {
-	struct hashmap_entry e;
-	const char *name;
-	size_t prefix_length;
-	/* if item is NULL, the prefix is not unique */
-	struct prefix_item *item;
-};
-
-struct prefix_map {
-	struct hashmap map;
-	int min_length, max_length;
-};
-
-/*
- * Find unique prefixes in a given list of strings.
- *
- * Typically, the `struct prefix_item` information will be but a field in the
- * actual item struct; For this reason, the `list` parameter is specified as a
- * list of pointers to the items.
- *
- * The `min_length`/`max_length` parameters define what length the unique
- * prefixes should have.
- *
- * If no unique prefix could be found for a given item, its `prefix_length`
- * will be set to 0.
- */
-void find_unique_prefixes(struct prefix_item **list, size_t nr,
-			  int min_length, int max_length);
-
-#endif
diff --git a/t/helper/test-prefix-map.c b/t/helper/test-prefix-map.c
index 3f1c90eaf0..d472ff5dc6 100644
--- a/t/helper/test-prefix-map.c
+++ b/t/helper/test-prefix-map.c
@@ -1,6 +1,5 @@
 #include "test-tool.h"
-#include "cache.h"
-#include "prefix-map.h"
+#include "unique-prefix.h"
 
 static size_t test_count, failed_count;
 
@@ -24,25 +23,32 @@ static void check(int succeeded, const char *file, size_t line_no,
 
 #define EXPECT_SIZE_T_EQUALS(expect, actual, hint) \
 	check(expect == actual, __FILE__, __LINE__, \
-	      "size_t's do not match: %" \
-	      PRIdMAX " != %" PRIdMAX " (%s) (%s)", \
+	      "size_t's do not match: expected: %" \
+	      PRIdMAX " got: %" PRIdMAX " (%s) (%s)", \
 	      (intmax_t)expect, (intmax_t)actual, #actual, hint)
 
 int cmd__prefix_map(int argc, const char **argv)
 {
-#define NR 5
-	struct prefix_item items[NR] = {
+	size_t i;
+	struct prefix_item items[] = {
 		{ "unique" },
 		{ "hell" },
 		{ "hello" },
 		{ "wok" },
 		{ "world" },
+		{ "a" },
+		{ "" },
+		{ "pq" },
+		{ "pq" },
+		{ "pqr" },
 	};
-	struct prefix_item *list[NR] = {
-		items, items + 1, items + 2, items + 3, items + 4
-	};
+	struct prefix_item *list[ARRAY_SIZE(items)];
+	for (i = 0; i < ARRAY_SIZE(items); i++) {
+		list[i] = &items[i];
+		list[i]->prefix_length = 12345; /* dummy */
+	}
 
-	find_unique_prefixes(list, NR, 1, 3);
+	find_unique_prefixes(list, ARRAY_SIZE(list), 1, 3);
 
 #define EXPECT_PREFIX_LENGTH_EQUALS(expect, index) \
 	EXPECT_SIZE_T_EQUALS(expect, list[index]->prefix_length, \
@@ -53,6 +59,11 @@ int cmd__prefix_map(int argc, const char **argv)
 	EXPECT_PREFIX_LENGTH_EQUALS(0, 2);
 	EXPECT_PREFIX_LENGTH_EQUALS(3, 3);
 	EXPECT_PREFIX_LENGTH_EQUALS(3, 4);
+	EXPECT_PREFIX_LENGTH_EQUALS(1, 5);
+	EXPECT_PREFIX_LENGTH_EQUALS(0, 6);
+	EXPECT_PREFIX_LENGTH_EQUALS(0, 7);
+	EXPECT_PREFIX_LENGTH_EQUALS(0, 8);
+	EXPECT_PREFIX_LENGTH_EQUALS(3, 9);
 
 	return !!failed_count;
 }
diff --git a/unique-prefix.c b/unique-prefix.c
new file mode 100644
index 0000000000..327e8fa32c
--- /dev/null
+++ b/unique-prefix.c
@@ -0,0 +1,73 @@
+#include "git-compat-util.h"
+#include "unique-prefix.h"
+
+static int prefix_item_ptr_cmp(const void *item1, const void *item2)
+{
+	const struct prefix_item *pi1 = *((struct prefix_item**) item1);
+	const struct prefix_item *pi2 = *((struct prefix_item**) item2);
+	return strcmp(pi1->name, pi2->name);
+}
+
+static int str_is_shorter_than(const char *s, size_t len)
+{
+	for (; *s && len; s++, len--);
+	return !!len;
+}
+
+static size_t str_common_prefix_len(const char *s1, const char *s2, size_t limit)
+{
+	size_t i;
+	for (i = 0; i < limit; i++)
+		if (s1[i] != s2[i] || s1[i] == '\0')
+			return i;
+	return limit + 1;
+}
+
+void find_unique_prefixes(struct prefix_item **items, size_t nr,
+			  int min_length, int max_length)
+{
+	size_t i;
+	struct prefix_item **sorted_items;
+
+	ALLOC_ARRAY(sorted_items, nr);
+	COPY_ARRAY(sorted_items, items, nr);
+	QSORT(sorted_items, nr, prefix_item_ptr_cmp);
+
+	if (str_is_shorter_than(sorted_items[0]->name, min_length))
+		sorted_items[0]->prefix_length = 0;
+	else
+		sorted_items[0]->prefix_length = min_length;
+	for (i = 1; i < nr; i++) {
+		size_t common_len = str_common_prefix_len(
+			sorted_items[i - 1]->name, sorted_items[i]->name,
+			max_length);
+
+		if (!sorted_items[i - 1]->prefix_length)
+			/*
+			 * The previous iteration already determined that
+			 * it doesn't have a unique prefix.
+			 */
+			;
+		else if (max_length < common_len)
+			sorted_items[i - 1]->prefix_length = 0;
+		else if (sorted_items[i - 1]->name[common_len] == '\0')
+			/* Either prefix of or equal to the next string. */
+			sorted_items[i - 1]->prefix_length = 0;
+		else if (sorted_items[i - 1]->prefix_length <= common_len)
+			sorted_items[i - 1]->prefix_length = common_len + 1;
+
+		if (max_length < common_len)
+			sorted_items[i]->prefix_length = 0;
+		else if (sorted_items[i]->name[common_len] == '\0')
+			/* the two strings are the same */
+			sorted_items[i]->prefix_length = 0;
+		else if (min_length <= common_len)
+			sorted_items[i]->prefix_length = common_len + 1;
+		else if (str_is_shorter_than(sorted_items[i]->name, min_length))
+			sorted_items[i]->prefix_length = 0;
+		else
+			sorted_items[i]->prefix_length = min_length;
+	}
+
+	free(sorted_items);
+}
diff --git a/unique-prefix.h b/unique-prefix.h
new file mode 100644
index 0000000000..cbddc29a9a
--- /dev/null
+++ b/unique-prefix.h
@@ -0,0 +1,28 @@
+#ifndef UNIQUE_PREFIX_H
+#define UNIQUE_PREFIX_H
+
+struct prefix_item {
+	const char *name;
+	size_t prefix_length;
+};
+
+/*
+ * Find unique prefixes in a given array of strings.
+ * Given a list of names, find unique prefixes (i.e. the first <n> characters
+ * that uniquely identify the names) and store the lengths of the unique
+ * prefixes in the 'prefix_length' field of the elements of the given array.
+ *
+ * Typically, the `struct prefix_item` information will be a field in the
+ * actual item struct; For this reason, the `items` parameter is specified
+ * as an array of pointers to the items.
+ *
+ * The `min_length`/`max_length` parameters define what length the unique
+ * prefixes should have.
+ *
+ * If no unique prefix could be found for a given item, its `prefix_length`
+ * will be set to 0.
+ */
+void find_unique_prefixes(struct prefix_item **items, size_t nr,
+			  int min_length, int max_length);
+
+#endif
-- 
2.23.0.331.g4e51dcdf11
Previous: SZEDER GáborNext: Johannes Schindelin
Message 54 of 124 in “git add -i: add a rudimentary version in C (supporting only status and help so far)”
  1. 00/11 git add -i: add a rudimentary version in C (supporting only status and help so far)Johannes Schindelin via GitGitGadget, Apr 10, 2019
  2. 01/11 Start to implement a built-in version of `git add --interactive`Johannes Schindelin via GitGitGadget, Apr 10, 2019
  3. Jeff HostetlerApr 18, 2019
  4. Jeff KingApr 18, 2019
  5. Johannes SchindelinApr 30, 2019
  6. Jeff KingMay 1, 2019
  7. Johannes SchindelinMay 13, 2019
  8. 02/11 diff: export diffstat interfaceDaniel Ferreira via GitGitGadget, Apr 10, 2019
  9. 04/11 built-in add -i: refresh the index before running `status`Johannes Schindelin via GitGitGadget, Apr 10, 2019
  10. 03/11 built-in add -i: implement the `status` commandDaniel Ferreira via GitGitGadget, Apr 10, 2019
  11. 05/11 built-in add -i: color the header in the `status` commandJohannes Schindelin via GitGitGadget, Apr 10, 2019
  12. 06/11 built-in add -i: implement the main loopJohannes Schindelin via GitGitGadget, Apr 10, 2019
  13. Jeff HostetlerApr 18, 2019
  14. Johannes SchindelinMay 13, 2019
  15. 09/11 built-in add -i: support `?` (prompt help)Johannes Schindelin via GitGitGadget, Apr 10, 2019
  16. 08/11 built-in add -i: show unique prefixes of the commandsSlavica Djukic via GitGitGadget, Apr 10, 2019
  17. 07/11 Add a function to determine unique prefixes for a list of stringsSlavica Djukic via GitGitGadget, Apr 10, 2019
  18. Jeff HostetlerApr 18, 2019
  19. Johannes SchindelinMay 13, 2019
  20. 10/11 built-in add -i: use color in the main loopSlavica Djukic via GitGitGadget, Apr 10, 2019
  21. 11/11 built-in add -i: implement the `help` commandJohannes Schindelin via GitGitGadget, Apr 10, 2019
  22. 00/11 git add -i: add a rudimentary version in C (supporting only status and help so far)Johannes Schindelin via GitGitGadget, May 13, 2019
  23. 02/11 diff: export diffstat interfaceDaniel Ferreira via GitGitGadget, May 13, 2019
  24. 04/11 built-in add -i: refresh the index before running `status`Johannes Schindelin via GitGitGadget, May 13, 2019
  25. 06/11 built-in add -i: implement the main loopJohannes Schindelin via GitGitGadget, May 13, 2019
  26. 08/11 built-in add -i: show unique prefixes of the commandsSlavica Djukic via GitGitGadget, May 13, 2019
  27. 11/11 built-in add -i: implement the `help` commandJohannes Schindelin via GitGitGadget, May 13, 2019
  28. 10/11 built-in add -i: use color in the main loopSlavica Djukic via GitGitGadget, May 13, 2019
  29. 07/11 Add a function to determine unique prefixes for a list of stringsSlavica Djukic via GitGitGadget, May 13, 2019
  30. 05/11 built-in add -i: color the header in the `status` commandJohannes Schindelin via GitGitGadget, May 13, 2019
  31. 09/11 built-in add -i: support `?` (prompt help)Johannes Schindelin via GitGitGadget, May 13, 2019
  32. 01/11 Start to implement a built-in version of `git add --interactive`Johannes Schindelin via GitGitGadget, May 13, 2019
  33. 03/11 built-in add -i: implement the `status` commandDaniel Ferreira via GitGitGadget, May 13, 2019
  34. 00/11 git add -i: add a rudimentary version in C (supporting only status and help so far)Johannes Schindelin via GitGitGadget, Jul 16, 2019
  35. 01/11 Start to implement a built-in version of `git add --interactive`Johannes Schindelin via GitGitGadget, Jul 16, 2019
  36. Junio C HamanoJul 31, 2019
  37. Johannes SchindelinAug 26, 2019
  38. Junio C HamanoAug 27, 2019
  39. Johannes SchindelinAug 28, 2019
  40. Junio C HamanoAug 28, 2019
  41. 02/11 diff: export diffstat interfaceDaniel Ferreira via GitGitGadget, Jul 16, 2019
  42. Junio C HamanoJul 31, 2019
  43. Johannes SchindelinAug 27, 2019
  44. 05/11 built-in add -i: color the header in the `status` commandJohannes Schindelin via GitGitGadget, Jul 16, 2019
  45. 04/11 built-in add -i: refresh the index before running `status`Johannes Schindelin via GitGitGadget, Jul 16, 2019
  46. 06/11 built-in add -i: implement the main loopJohannes Schindelin via GitGitGadget, Jul 16, 2019
  47. Junio C HamanoJul 31, 2019
  48. 08/11 built-in add -i: show unique prefixes of the commandsSlavica Djukic via GitGitGadget, Jul 16, 2019
  49. 07/11 Add a function to determine unique prefixes for a list of stringsSlavica Djukic via GitGitGadget, Jul 16, 2019
  50. Junio C HamanoJul 31, 2019
  51. SZEDER GáborAug 24, 2019
  52. Johannes SchindelinAug 27, 2019
  53. SZEDER GáborAug 28, 2019
  54. [PoC] A simpler find_unique_prefixes() implementationSZEDER Gábor, Aug 28, 2019
  55. Johannes SchindelinAug 30, 2019
  56. 09/11 built-in add -i: support `?` (prompt help)Johannes Schindelin via GitGitGadget, Jul 16, 2019
  57. 03/11 built-in add -i: implement the `status` commandDaniel Ferreira via GitGitGadget, Jul 16, 2019
  58. Junio C HamanoJul 31, 2019
  59. Johannes SchindelinAug 27, 2019
  60. 10/11 built-in add -i: use color in the main loopSlavica Djukic via GitGitGadget, Jul 16, 2019
  61. 11/11 built-in add -i: implement the `help` commandJohannes Schindelin via GitGitGadget, Jul 16, 2019
  62. Junio C HamanoAug 2, 2019
  63. Jeff KingAug 2, 2019
  64. Johannes SchindelinJul 16, 2019
  65. Junio C HamanoAug 2, 2019
  66. 00/11 git add -i: add a rudimentary version in C (supporting only status and help so far)Johannes Schindelin via GitGitGadget, Aug 27, 2019
  67. 01/11 Start to implement a built-in version of `git add --interactive`Johannes Schindelin via GitGitGadget, Aug 27, 2019
  68. 08/11 built-in add -i: show unique prefixes of the commandsSlavica Djukic via GitGitGadget, Aug 27, 2019
  69. 03/11 built-in add -i: implement the `status` commandDaniel Ferreira via GitGitGadget, Aug 27, 2019
  70. 06/11 built-in add -i: implement the main loopJohannes Schindelin via GitGitGadget, Aug 27, 2019
  71. 04/11 built-in add -i: refresh the index before running `status`Johannes Schindelin via GitGitGadget, Aug 27, 2019
  72. 09/11 built-in add -i: support `?` (prompt help)Johannes Schindelin via GitGitGadget, Aug 27, 2019
  73. 11/11 built-in add -i: implement the `help` commandJohannes Schindelin via GitGitGadget, Aug 27, 2019
  74. 10/11 built-in add -i: use color in the main loopSlavica Djukic via GitGitGadget, Aug 27, 2019
  75. 02/11 diff: export diffstat interfaceDaniel Ferreira via GitGitGadget, Aug 27, 2019
  76. 07/11 Add a function to determine unique prefixes for a list of stringsSlavica Djukic via GitGitGadget, Aug 27, 2019
  77. 05/11 built-in add -i: color the header in the `status` commandJohannes Schindelin via GitGitGadget, Aug 27, 2019
  78. 0/9 git add -i: add a rudimentary version in C (supporting only status and help so far)Johannes Schindelin via GitGitGadget, Nov 4, 2019
  79. 1/9 Start to implement a built-in version of `git add --interactive`Johannes Schindelin via GitGitGadget, Nov 4, 2019
  80. Junio C HamanoNov 8, 2019
  81. Johannes SchindelinNov 9, 2019
  82. Junio C HamanoNov 10, 2019
  83. Johannes SchindelinNov 11, 2019
  84. Junio C HamanoNov 11, 2019
  85. Johannes SchindelinNov 12, 2019
  86. Junio C HamanoNov 13, 2019
  87. Johannes SchindelinNov 13, 2019
  88. Junio C HamanoNov 13, 2019
  89. 4/9 built-in add -i: color the header in the `status` commandSlavica Đukić via GitGitGadget, Nov 4, 2019
  90. 3/9 built-in add -i: implement the `status` commandDaniel Ferreira via GitGitGadget, Nov 4, 2019
  91. Junio C HamanoNov 8, 2019
  92. 2/9 diff: export diffstat interfaceDaniel Ferreira via GitGitGadget, Nov 4, 2019
  93. Junio C HamanoNov 8, 2019
  94. 7/9 built-in add -i: support `?` (prompt help)Johannes Schindelin via GitGitGadget, Nov 4, 2019
  95. 5/9 built-in add -i: implement the main loopJohannes Schindelin via GitGitGadget, Nov 4, 2019
  96. Junio C HamanoNov 8, 2019
  97. Johannes SchindelinNov 9, 2019
  98. 8/9 built-in add -i: use color in the main loopSlavica Đukić via GitGitGadget, Nov 4, 2019
  99. 9/9 built-in add -i: implement the `help` commandSlavica Đukić via GitGitGadget, Nov 4, 2019
  100. 6/9 built-in add -i: show unique prefixes of the commandsJohannes Schindelin via GitGitGadget, Nov 4, 2019
  101. 0/9 git add -i: add a rudimentary version in C (supporting only status and help so far)Johannes Schindelin via GitGitGadget, Nov 13, 2019
  102. 2/9 diff: export diffstat interfaceDaniel Ferreira via GitGitGadget, Nov 13, 2019
  103. 1/9 Start to implement a built-in version of `git add --interactive`Johannes Schindelin via GitGitGadget, Nov 13, 2019
  104. Junio C HamanoNov 14, 2019
  105. Johannes SchindelinNov 14, 2019
  106. Junio C HamanoNov 15, 2019
  107. 3/9 built-in add -i: implement the `status` commandDaniel Ferreira via GitGitGadget, Nov 13, 2019
  108. 6/9 built-in add -i: show unique prefixes of the commandsJohannes Schindelin via GitGitGadget, Nov 13, 2019
  109. 7/9 built-in add -i: support `?` (prompt help)Johannes Schindelin via GitGitGadget, Nov 13, 2019
  110. 9/9 built-in add -i: implement the `help` commandSlavica Đukić via GitGitGadget, Nov 13, 2019
  111. 5/9 built-in add -i: implement the main loopJohannes Schindelin via GitGitGadget, Nov 13, 2019
  112. 8/9 built-in add -i: use color in the main loopSlavica Đukić via GitGitGadget, Nov 13, 2019
  113. 4/9 built-in add -i: color the header in the `status` commandSlavica Đukić via GitGitGadget, Nov 13, 2019
  114. Johannes SchindelinNov 13, 2019
  115. 0/9 git add -i: add a rudimentary version in C (supporting only status and help so far)Johannes Schindelin via GitGitGadget, Nov 15, 2019
  116. 1/9 Start to implement a built-in version of `git add --interactive`Johannes Schindelin via GitGitGadget, Nov 15, 2019
  117. 4/9 built-in add -i: color the header in the `status` commandSlavica Đukić via GitGitGadget, Nov 15, 2019
  118. 7/9 built-in add -i: support `?` (prompt help)Johannes Schindelin via GitGitGadget, Nov 15, 2019
  119. 5/9 built-in add -i: implement the main loopJohannes Schindelin via GitGitGadget, Nov 15, 2019
  120. 2/9 diff: export diffstat interfaceDaniel Ferreira via GitGitGadget, Nov 15, 2019
  121. 6/9 built-in add -i: show unique prefixes of the commandsJohannes Schindelin via GitGitGadget, Nov 15, 2019
  122. 3/9 built-in add -i: implement the `status` commandDaniel Ferreira via GitGitGadget, Nov 15, 2019
  123. 8/9 built-in add -i: use color in the main loopSlavica Đukić via GitGitGadget, Nov 15, 2019
  124. 9/9 built-in add -i: implement the `help` commandSlavica Đukić via GitGitGadget, Nov 15, 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.