git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git subtree oddity
@ 2013-03-28  3:12 Thomas Taranowski
  2013-03-28 13:34 ` Stephen Smith
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Taranowski @ 2013-03-28  3:12 UTC (permalink / raw)
  To: git

I'd like to have the following configuration:

/myproject.git
|__/upstream_dependency -- Points to a remote library git repo
|__/project_source -- local project source


I issue the following commands to pull in the upstream dependency as a
subtree of the myproject.git repo:

git remote add upstream git://gnuradio.org/gnuradio
git fetch upstream
git checkout master
git subtree add -P upstream upstream/master

Now, my expectation is that I would have the following:

/myproject.git
|__/upstream_dependency -- Points to a remote library git repo
|____< all the upstream files are present here, as expected >
|__/project_source < this is still intact, as expected >
|__< all the upstream files are present here. wtf?>

My question is, why does "subtree add" pull in all the subtree files
into the root of the repo, and not just into the specified subtree
prefix?

#
# Here's an excerpt of what I see:
#
$:~/scratch/myproject.git$ ls
AUTHORS         gr-comedi               gr-utils
cmake           gr-digital              gr-video-sdl
CMakeLists.txt  gr-fcd                  gr-vocoder
config.h.in     gr-fft                  gr-wavelet
COPYING         gr-filter               gr-wxgui
docs            gr-howto-write-a-block  README
dtools          gr-noaa                 README.building-boost
gnuradio-core   gr-pager                README.hacking
gr-analog       gr-qtgui                README-win32-mingw-short.txt
gr-atsc         gr-shd                  upstream <---- the subtree directory
gr-audio        gr-trellis              volk
gr-blocks       gruel
grc             gr-uh

#
# Also, those same files are in the upstream subtree directory as well
(as expected)
#
$:~/scratch/myproject.git$ ls upstream
AUTHORS         grc                     gruel
cmake           gr-comedi               gr-uhd
CMakeLists.txt  gr-digital              gr-utils
config.h.in     gr-fcd                  gr-video-sdl
COPYING         gr-fft                  gr-vocoder
docs            gr-filter               gr-wavelet
dtools          gr-howto-write-a-block  gr-wxgui
gnuradio-core   gr-noaa                 README
gr-analog       gr-pager                README.building-boost
gr-atsc         gr-qtgui                README.hacking
gr-audio        gr-shd                  README-win32-mingw-short.txt
gr-blocks       gr-trellis              volk

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-03-29  5:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-28  3:12 git subtree oddity Thomas Taranowski
2013-03-28 13:34 ` Stephen Smith
2013-03-28 16:03   ` Junio C Hamano
2013-03-28 16:34     ` Jeremy Rosen
2013-03-28 19:29       ` Thomas Taranowski
2013-03-28 19:44         ` Thomas Taranowski
2013-03-29  5:47       ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).