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

[git wiki PATCH 3/3] "Improving the `git add -p` interface" project

From
Thomas Rast <trast@student.ethz.ch>
Date
Mar 2, 2012, 11:05 UTC
Message-ID
<544c3150818d928e14f40b362feb6dbabb348c9f.1330686331.git.trast@student.ethz.ch>
In-Reply-To
<57e8b4eb7a98af33982c2f3a763e18f62b1d6d6d.1330686331.git.trast@student.ethz.ch>
---
 SoC-2012-Ideas.md |   41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
diff --git a/SoC-2012-Ideas.md b/SoC-2012-Ideas.md
index 59d1baf..b2cc475 100644
--- a/SoC-2012-Ideas.md
+++ b/SoC-2012-Ideas.md
@@ -140,3 +140,44 @@ The programming work will be in C, as it replaces a core part of git.
 
 Proposed by: Thomas Rast
 Possible mentor(s): Thomas Rast
+
+Improving the `git add -p` interface
+------------------------------------
+
+The interface behind `git {add|commit|stash|reset} {-p|-i}` is shared
+and called `git-add--interactive.perl`.    This project would mostly
+focus on the `--patch` side, as that seems to be much more widely
+used; however, improvements to `--interactive` would probably also be
+welcome.
+
+The `--patch` interface suffers from some design flaws caused largely
+by how the script grew:
+
+ * Application is not atomic: hitting Ctrl-C midway through patching
+   may still touch files.
+
+ * The terminal/line-based interface becomes a problem if diff hunks
+   are too long to fit in your terminal.
+
+ * Cannot go back and forth between files.
+
+ * Cannot reverse the direction of the patch.
+
+ * Cannot look at the diff in word-diff mode (and apply it normally).
+
+Due to the current design it is also pretty hard to add these features
+without adding to the mess.  Thus the project consists of:
+
+ * Come up with more ideas for features/improvements and discuss them
+   with users.
+
+ * Cleanly redesigning the main interface loop to allow for the above
+   features.
+
+ * Implement the new features.
+
+As the existing code is written in Perl, that is what you will use for
+this project.
+
+Proposed by: Thomas Rast
+Possible mentor(s): Thomas Rast
-- 
1.7.9.2.467.g7fee4
Previous: Nguyen Thai Ngoc DuyNext: Nguyen Thai Ngoc Duy
Message 6 of 8 in “"Improving parallelism in various commands" project”
  1. 1/3 "Improving parallelism in various commands" projectThomas Rast, Mar 2, 2012
  2. 2/3 "Designing a faster index format" projectThomas Rast, Mar 2, 2012
  3. Jeff KingMar 2, 2012
  4. Junio C HamanoMar 2, 2012
  5. Nguyen Thai Ngoc DuyMar 3, 2012
  6. 3/3 "Improving the `git add -p` interface" projectThomas Rast, Mar 2, 2012
  7. Nguyen Thai Ngoc DuyMar 2, 2012
  8. James PickensMar 2, 2012

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.