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

Re: How to deal with mixed tree?

From
HHHolger Hellmuth <hellmuth@ira.uka.de>
Date
Nov 22, 2011, 16:14 UTC
Message-ID
<4ECBCA4F.5090505@ira.uka.de>
In-Reply-To
<4ECBBDE3.3010904@obry.net>
On 22.11.2011 16:21, Pascal Obry wrote:
> In fact I want to do that in a branch (say work) and keep master as-is
> as this branch is used to pull changes from origin. And in this case,
> doing 'git diff master' still shows the files under src2. See script to
> reproduce:
[...]
Show 26 quoted lines
> # let's replace src2 by sd in branch work
>
> git checkout -b work
> git rm src2/*
> git ci -m "no more src2"
> # ln -s ../sd src2
> cp -r ../sd src2
>
> # make sure src2 is excluded
>
> echo 'src2'>>  .git/info/exclude
>
> # the following output should be clean
>
> echo '============== Status'
> git status
>
> echo '============== Diff'
> git diff
>
> echo '============== Diff master'
> git diff master
>>>
>
> Is that possible?
>

In my not-really-expert opinion no. At least git diff master has to show something because there obviously is a difference between what is in master (that you can't gitignore) and your branch (whether you ignore it or not).

I would

a) use a different directory name for src2 and adapt the Makefile to cope with that

or

b) remove the src2 link from .git/info/exclude and commit it into the branch. That way whenever you switch branch and master, the correct dir or link will be present and still because of the link none of the files in the svn will be handled by git in any way

Previous: Pascal ObryNext: Pascal Obry
Message 6 of 8 in “How to deal with mixed tree?”
  1. Pascal ObryNov 22, 2011
  2. Holger HellmuthNov 22, 2011
  3. Pascal ObryNov 22, 2011
  4. Holger HellmuthNov 22, 2011
  5. Pascal ObryNov 22, 2011
  6. Holger HellmuthNov 22, 2011
  7. Pascal ObryNov 22, 2011
  8. Junio C HamanoNov 22, 2011

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.