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

Re: Merge with local conflicts in new files

From
PRPavel Roskin <proski@gnu.org>
Date
May 17, 2006, 07:47 UTC
Message-ID
<1147852052.31879.50.camel@dv>
In-Reply-To
<7vu07p35xn.fsf@assigned-by-dhcp.cox.net>
Hello, Junio!
On Tue, 2006-05-16 at 16:28 -0700, Junio C Hamano wrote:
Show 17 quoted lines
> Santi <sbejar@gmail.com> writes:
> 
> > 2006/5/17, Junio C Hamano <junkio@cox.net>:
> >>  - You have not told git that these files matter.
> >
> > For me it is the other way, all my files matter but git can do
> > whatever it wants with the ones it controls.
> 
> You really do not mean that.
> 
> If you told git a file matters, and have local modifications to
> the file in the working tree that you have not run update-index
> yet, merge and apply should be careful not to overwrite your
> changes that is not ready while doing whatever thing they have
> to do.  And they are careful, because you have told git that
> they matter, and the way you tell git that they matter is to
> have entries for them in the index.

I'm afraid this approach, while understandable from the technical standpoint, could prevent git from ever becoming a version control system that "just works" without any porcelains.

I know a person who refuses to use any version control. If he encountered this situation, he would never try any version control again.

After all, we are talking about files in the _working_ directory. It's not merely a transient appendix to the repository. git is not the only player here. If a file doesn't "belong" to git, it belongs to its "supreme commander", i.e. the user, and should be approached with utmost care.

Merging a branch should not cause an irreparable loss of user data. The same applies to other commands. Exceptions can be made for commands that are specifically meant to clean user data, for commands with special options (e.g. --force or --hard), and for the files explicitly marked as transient (e.g. in .gitignore).

-- 
Regards,
Pavel Roskin
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 10 in “Merge with local conflicts in new files”
  1. SantiMay 16, 2006
  2. SantiMay 16, 2006
  3. Junio C HamanoMay 16, 2006
  4. SantiMay 16, 2006
  5. Junio C HamanoMay 16, 2006
  6. Pavel RoskinMay 17, 2006
  7. Junio C HamanoMay 17, 2006
  8. Martin LanghoffMay 17, 2006
  9. read-tree -m -u: do not overwrite or remove untracked working tree files.Junio C Hamano, May 17, 2006
  10. Jakub NarebskiMay 17, 2006

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.