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

A question about using 'add -p' to split the patch

From
Ping Yin <pkufranky@gmail.com>
Date
Jun 15, 2009, 03:08 UTC
Message-ID
<46dff0320906142008v4f278d3ek3eebfa36f7fcf06a@mail.gmail.com>
file bt.php in the HEAD:
function bt_add($path) {
 return;
}
file bt.php in the working directory:
function bt_move($path, $pos) {
  return;
}
function bt_add($path, $pos) {
  bt_move($path, $pos)
  return;
}

Now i want to split the change into two parts: First introduce bt_move Then add a param pos to bt_add and call bt_move

With the 'e' action of 'add -p', i got
-function bt_add($path) {
+function bt_move($path, $pos) {
+  return;
+}
+function bt_add($path, $pos) {
+  bt_move($path, $pos)
   return;
 }
Then, i want to edit the patch to get
function bt_move($path, $pos) {
  return;
}
function bt_add($path) {
  return;
}
However, whatever i do, the patch fails to apply. Any suggestion?
-
Ping Yin
Next: David Aguilar
Message 1 of 5 in “A question about using 'add -p' to split the patch”
  1. Ping YinJun 15, 2009
  2. David AguilarJun 15, 2009
  3. Ping YinJun 15, 2009
  4. David AguilarJun 15, 2009
  5. Ping YinJun 15, 2009

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.