* A good Git technique for referring back to original files
@ 2013-02-12 8:11 MikeW
2013-02-12 8:56 ` Matthieu Moy
0 siblings, 1 reply; 6+ messages in thread
From: MikeW @ 2013-02-12 8:11 UTC (permalink / raw)
To: git
Hi,
I have a client with an SDK product. Normally the SDK is used in its unpackaged
form by the end-user, and that is the directory structure and set of files in
which development work on the SDK functionality is performed.
However the SDK directory and content is generated from a packager which first
runs on numerous other version controlled projects (currently CVS projects -
this is unlikely to change).
This means that once changes to the unpackaged SDK have been tested, they have
to be cross-referred back to the original projects and the changes ported back.
I have found it most convenient to control my in-SDK changes with git.
However it's still a royal pain to cross-refer and diff the changes back to the
originals, especially since duplicate file names exist across the original
projects which get filtered down to one relevant instance by the packager.
Since git is so good at tracking file content, I wondered whether there was any
technique using git that would simplify the back-referencing task.
Failing a method using git 'normally', perhaps building a script on top of the
git file system might be a possibility - if that is feasible ...
Thanks,
MikeW
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: A good Git technique for referring back to original files
2013-02-12 8:11 A good Git technique for referring back to original files MikeW
@ 2013-02-12 8:56 ` Matthieu Moy
2013-02-12 10:19 ` MikeW
0 siblings, 1 reply; 6+ messages in thread
From: Matthieu Moy @ 2013-02-12 8:56 UTC (permalink / raw)
To: MikeW; +Cc: git
MikeW <mw_phil@yahoo.co.uk> writes:
> Since git is so good at tracking file content, I wondered whether there was any
> technique using git that would simplify the back-referencing task.
I'm not sure I understand the question, but if you want to add meta-data
to Git commits (e.g. "this Git commit is revision 42 in CVS repository
foo"), then have a look at git-notes. It won't give you directly
"reference to other VCS", but at least can be used as a storage
mechanism to store these references.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: A good Git technique for referring back to original files
2013-02-12 8:56 ` Matthieu Moy
@ 2013-02-12 10:19 ` MikeW
2013-02-12 23:13 ` Paul Campbell
0 siblings, 1 reply; 6+ messages in thread
From: MikeW @ 2013-02-12 10:19 UTC (permalink / raw)
To: git
Matthieu Moy <Matthieu.Moy <at> grenoble-inp.fr> writes:
>
> MikeW <mw_phil <at> yahoo.co.uk> writes:
>
> > Since git is so good at tracking file content, I wondered whether
there was any
> > technique using git that would simplify the back-referencing task.
>
> I'm not sure I understand the question, but if you want to add meta-data
> to Git commits (e.g. "this Git commit is revision 42 in CVS repository
> foo"), then have a look at git-notes. It won't give you directly
> "reference to other VCS", but at least can be used as a storage
> mechanism to store these references.
>
Thanks for the reply.
In my work environment both the SDK and the original files are available
(in an enclosing directory).
--SDK_content
|
SDK_subproj1-- ...
| |
| content
|
SDK_subproj2- ...
| |
| content
|
SDK_subprojN- ...
| |
| content
|
Working_SDK ... (under git, baseline generated from subproj1..N)
|
content derived from subproj1..N
What I had in mind was something I could run over, say, SDK_content
(alternatively, from within Working_SDK, referring back to SDK_content)
which would note the changed files in Working_SDK and locate the
original files in SDK_subproj1..N letting me merge the changes back.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: A good Git technique for referring back to original files
2013-02-12 10:19 ` MikeW
@ 2013-02-12 23:13 ` Paul Campbell
2013-02-13 11:44 ` MikeW
0 siblings, 1 reply; 6+ messages in thread
From: Paul Campbell @ 2013-02-12 23:13 UTC (permalink / raw)
To: MikeW; +Cc: git
Hi Mike,
I think git-cvsimport and git-subtree could help you here.
Roughly:
# Create a git version of each SDK_subproj
git cvsimport -r upstream -d $CVSREPO1 $CVSMODULE1 -C SDK_subproj1
git cvsimport -r upstream -d $CVSREPO2 $CVSMODULE2 -C SDK_subproj2
# Create your Working_SDK
git init Working_SDK
cd Working_SDK
# Import the SDK_subprojN repos
git subtree add --prefix=subproj1 ../SDK_subproj1 upstream/master
git subtree add --prefix=subproj2 ../SDK_subproj2 upstream/master
# Edit and commit your files
# N.B. when committing don't commit to more than one subproj in a single commit
# Update from the upstream CVS as needed
git cvsimport -r upstream -d $CVSREPO1 $CVSMODULE1 -C ../SDK_subproj1
git subtree pull --prefix=subproj1 ../SDK_subproj1 upstream/master
git cvsimport -r upstream -d $CVSREPO2 $CVSMODULE2 -C ../SDK_subproj2
git subtree pull --prefix=subproj2 ../SDK_subproj2 upstream/master
# Push your changes back to SDK_subproj repos into a branch other than master
git subtree push --prefix=subproj1 ../SDK_subproj1 new-branch
git subtree push --prefix=subproj1 ../SDK_subproj2 new-branch
# Prepare patches to apply to a real CVS copy or submit upstream
(cd ../SDK_subproj1 && git format-patch upstream/master..new-branch)
(cd ../SDK_subproj2 && git format-patch upstream/master..new-branch)
Hope that helps.
--
Paul
On Tue, Feb 12, 2013 at 10:19 AM, MikeW <mw_phil@yahoo.co.uk> wrote:
> Matthieu Moy <Matthieu.Moy <at> grenoble-inp.fr> writes:
>
>>
>> MikeW <mw_phil <at> yahoo.co.uk> writes:
>>
>> > Since git is so good at tracking file content, I wondered whether
> there was any
>> > technique using git that would simplify the back-referencing task.
>>
>> I'm not sure I understand the question, but if you want to add meta-data
>> to Git commits (e.g. "this Git commit is revision 42 in CVS repository
>> foo"), then have a look at git-notes. It won't give you directly
>> "reference to other VCS", but at least can be used as a storage
>> mechanism to store these references.
>>
> Thanks for the reply.
>
> In my work environment both the SDK and the original files are available
> (in an enclosing directory).
>
> --SDK_content
> |
> SDK_subproj1-- ...
> | |
> | content
> |
> SDK_subproj2- ...
> | |
> | content
> |
> SDK_subprojN- ...
> | |
> | content
> |
> Working_SDK ... (under git, baseline generated from subproj1..N)
> |
> content derived from subproj1..N
>
>
> What I had in mind was something I could run over, say, SDK_content
> (alternatively, from within Working_SDK, referring back to SDK_content)
> which would note the changed files in Working_SDK and locate the
> original files in SDK_subproj1..N letting me merge the changes back.
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Paul [W] Campbell
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: A good Git technique for referring back to original files
2013-02-12 23:13 ` Paul Campbell
@ 2013-02-13 11:44 ` MikeW
2013-02-13 12:50 ` MikeW
0 siblings, 1 reply; 6+ messages in thread
From: MikeW @ 2013-02-13 11:44 UTC (permalink / raw)
To: git
Paul Campbell <pcampbell <at> kemitix.net> writes:
>
> Hi Mike,
>
> I think git-cvsimport and git-subtree could help you here.
>
That looks very interesting, had not considered git subtree and it looks like
the right kind of method.
Thanks.
Mike
> Hope that helps.
>
> --
> Paul
>
... Super-Snip ...
>
> --
> Paul [W] Campbell
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: A good Git technique for referring back to original files
2013-02-13 11:44 ` MikeW
@ 2013-02-13 12:50 ` MikeW
0 siblings, 0 replies; 6+ messages in thread
From: MikeW @ 2013-02-13 12:50 UTC (permalink / raw)
To: git
MikeW <mw_phil <at> yahoo.co.uk> writes:
>
> Paul Campbell <pcampbell <at> kemitix.net> writes:
>
> >
> > Hi Mike,
> >
> > I think git-cvsimport and git-subtree could help you here.
> >
>
> That looks very interesting, had not considered git subtree and it looks like
> the right kind of method.
>
> Thanks.
> Mike
The only alternative I can think of is to scan through Working_SDK and replace
the files there with symlinks back to the matching files within the
original subprojects - such scripts exist !
Then any changes in Working_SDK will update the (baselined) originals in-place.
But then no explicit use of git except for tracking work prior to pushing
back to CVS.
Oh well, thanks for ideas, will see which work best.
Mike
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-02-13 12:52 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-12 8:11 A good Git technique for referring back to original files MikeW
2013-02-12 8:56 ` Matthieu Moy
2013-02-12 10:19 ` MikeW
2013-02-12 23:13 ` Paul Campbell
2013-02-13 11:44 ` MikeW
2013-02-13 12:50 ` MikeW
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).