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

Re: cg-update with local uncommitted changes

From
MHMarcel Holtmann <marcel@holtmann.org>
Date
May 30, 2005, 19:19 UTC
Message-ID
<1117480796.7072.204.camel@pegasus>
In-Reply-To
<20050530183932.GB10439@pasky.ji.cz>
Hi Petr,
Show 26 quoted lines
> > when doing a cg-update and I have local uncommitted changes it fails
> > with the "... needs update" message. From some previous posts on the
> > mailing list I got the impression that it is possible to pull updates
> > into the local repository with changed files. At the moment I am using
> > the following sequence:
> > 
> > 	cg-diff > patch
> > 	cg-cancel
> > 	cg-update origin
> > 	cat patch | patch -p1
> > 	rm patch
> > 
> > The problem with this sequence is when I have added or removed files
> > from my repository. This needs a lot of manual fixing.
> > 
> > With Bitkeeper it was possible to pull changes as long as they don't
> > affect local uncommitted files.
> > 
> > Any ideas on how to implement or if it exists on how to use it?
> 
> does it really fail? "... needs update" is not an error but something
> between informative and warning message. (I've just committed a change
> which silences it in this case.)
> 
> If the update did indeed fail, could you show the complete output,
> please?

I used the latest cg-update on a test repository and now it works, but I found odd cases when I have files added/deleted that are not committed yet. For the added case I saw this:

Warning: uncommitted local changes, trying to bring them forward
The next patch would create the file test.c,
which already exists!  Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file test.c.rej
Adding file test.c

I also think that it would be great if we cancel the merge if the local changes conflict with the files in the merge. This is how Bitkeeper does it and I think it is the only safe way, because if something fails or rejects we may destroy the local changes.

Regards
Marcel
Previous: Petr BaudisNext: Marcel Holtmann
Message 3 of 12 in “cg-update with local uncommitted changes”
  1. Marcel HoltmannMay 30, 2005
  2. Petr BaudisMay 30, 2005
  3. Marcel HoltmannMay 30, 2005
  4. Marcel HoltmannMay 30, 2005
  5. Petr BaudisJun 2, 2005
  6. Marcel HoltmannJun 2, 2005
  7. Petr BaudisJun 5, 2005
  8. Dan HolmsandMay 30, 2005
  9. Petr BaudisMay 31, 2005
  10. Dan HolmsandMay 31, 2005
  11. Zack BrownMay 30, 2005
  12. Petr BaudisMay 31, 2005

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.