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

Re: [STGIT PATCH] replace "git repo-config" usage by "git config"

From
CMCatalin Marinas <catalin.marinas@gmail.com>
Date
Jan 24, 2008, 18:20 UTC
Message-ID
<b0943d9e0801241020y3ca5e5bah973922c4fc99f733@mail.gmail.com>
In-Reply-To
<20080124180835.GA28723@diana.vm.bytemark.co.uk>
On 24/01/2008, Karl Hasselström <kha@treskal.com> wrote:
Show 9 quoted lines
> On 2008-01-24 15:31:40 +0000, Catalin Marinas wrote:
>
> > Another thing, can the '--keep' option be added? Can it work with
> > the new structure? I use it quite often as I make some minor
> > modification and I'd like to pop patches without affecting the local
> > changes.
>
> As is, it works out of the box as long as your local changes are in
> files not touched by the command.
It used to work in this case as well :-).
Show 5 quoted lines
> Making it work in other cases as well should be doable -- behind the
> scenes, we'd save the local changes much like a patch, and try to
> apply it at the end. (In fact, we should probably not create this
> "patch" until git-read-tree tells us it can't do its job due to local
> changes.)

My simple approach was to apply the cumulated diff of the patches to be popped in reverse (and change the top of the stack). If there are no conflicts, it works just fine. If it cannot do this, there might be conflicts and I create a temporary patch manually. Merging that patch would probably lead to conflicts needing to be solved.

For the push operation, we try the diff applying followed by a three-way merge if the former fails. We could do something similar with the pop operation for keeping the local changes - try the reversed diff or create a temporary patch automatically.

But, I'd really like for this not to be enabled by default. I might forget to refresh a patch and will go to another just to realise that there are uncommitted changes, hence the "check_local_changes()" call for most of the commands affecting the stack.

-- 
Catalin
Previous: Karl Hasselström
Message 21 of 21 in “Remove repo-config”
  1. Remove repo-configDan McGee, Jan 16, 2008
  2. Junio C HamanoJan 16, 2008
  3. Dan McGeeJan 16, 2008
  4. Junio C HamanoJan 16, 2008
  5. Junio C HamanoJan 16, 2008
  6. Junio C HamanoJan 16, 2008
  7. Peter OberndorferJan 16, 2008
  8. replace "git repo-config" usage by "git config"Peter Oberndorfer, Jan 16, 2008
  9. Jakub NarebskiJan 16, 2008
  10. Peter OberndorferJan 16, 2008
  11. Catalin MarinasJan 17, 2008
  12. Jakub NarebskiJan 17, 2008
  13. Karl HasselströmJan 17, 2008
  14. Karl HasselströmJan 18, 2008
  15. Catalin MarinasJan 23, 2008
  16. Karl HasselströmJan 23, 2008
  17. Catalin MarinasJan 23, 2008
  18. Karl HasselströmJan 24, 2008
  19. Catalin MarinasJan 24, 2008
  20. Karl HasselströmJan 24, 2008
  21. Catalin MarinasJan 24, 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.