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

[STGIT] stg refresh wish (splitting patches/removing files from a patch)

From
Peter Oberndorfer <kumbayo84@arcor.de>
Date
Dec 30, 2007, 19:03 UTC
Message-ID
<200712302003.33478.kumbayo84@arcor.de>

Hi, I recently tried to split a stgit patch into 2 parts and it was not as easy as i would like it to be.

How do i exclude a file from a patch(use version of file present in HEAD^) without modifying the working dir?

with plain git i would use something like git reset HEAD^ files_i_do_not_want_in_first_patch git commit --amend git add files_i_do_not_want_in_first_patch git commit

So my idea was to add a --use-index [1] option to stg refresh When it is passed stg refresh will use the current index for the contenst of the refreshed patch instead of looking at the working dir. This would solve my problem[2] and also make it possible to use git-gui for staging hunks.

Do you think this would be a useful/good idea? Or do we want a separate command for removing files from a patch anyway?

Another thing that might be useful (in my scenario) would be a stg commit --top extension which commits at the top end of the stack (unfortunately this will loose the patch history for splitting commits) then i can edit this commits without being afraid of confusing stgit and then stg assimilate /stg repair to make them managed by stg again

Greetings Peter
[1] rename by desire

[2] new way for splitting a patch with extension git reset HEAD^ files_i_do_not_want_in_first_patch stg refresh --use-index stg refresh -e git add files_i_do_not_want_in_first_patch stg new stg refresh --use-index

Next: Peter Oberndorfer
Message 1 of 7 in “[STGIT] stg refresh wish (splitting patches/removing files from a patch)”
  1. Peter OberndorferDec 30, 2007
  2. refresh: add a --index option which takes the contents of the index as the new commitPeter Oberndorfer, Jan 2, 2008
  3. Karl HasselströmJan 7, 2008
  4. Karl HasselströmJan 7, 2008
  5. add a --index option to refresh which takes the contents of the index as the new commitPeter Oberndorfer, Jan 8, 2008
  6. Karl HasselströmJan 9, 2008
  7. Karl HasselströmJan 10, 2008

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.