git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to start well for a special git construction
@ 2010-03-18 19:26 bruno le hyaric
  2010-03-18 20:48 ` Avery Pennarun
  0 siblings, 1 reply; 4+ messages in thread
From: bruno le hyaric @ 2010-03-18 19:26 UTC (permalink / raw)
  To: git

Hi,

I'm working on an e-commerce development project based on Ruby on Rails.



On the left hand, I use one framework : Spree ;
on the other hand , I use Flex generation with another framework : RestfulX;
on my third hand ^^, I want to merge both in a third directory.

Basically, my root folder contains one directory for each : ./spree,
./restfulx, ./merge



The merge is a bit special, because Spree is a framework wich provide
extension feature, and Spree extensions are located in
./spree/vendor/extensions/extension_name. I want to merge resttfulx
folder as a spree extension (I heard about git-module, is this the
good way to solve my problem?)



Moreover, in both folder ./spree and ./restfulx I wan't to manage all
files with git (except databases and logs), but in ./restfulx there
are only few files I need to merge in ./merge. Those files are the
result of code generation from RestfulX. So I think I have to use
branch, one with all files, one which only contains files to 'deliver'
in ./merge.

In my current vision of git, I think branches are used for parallel
developments and are merged together after. In other words, in my
company I'm used to use ClearCase, and to have a development stream,
an integration stream and a release one, in the release stream, we
only deliver executable files, not all source code... I don't know if
Git branches can be seen as Clearcase streams...



Actually, I'm not in the company and I try to build the same
development process automated with git with framework installation
(Spree), code generation (RestfulX) and integration (./merge).

Any advice on how to start will be very helpful.
Do I need several repositories?
Can I use Git-plugins to integrate ./restfulx at a special location in ./merge?
Can I merge only specific files from a repository?


Best regards,

Bruno.

---------------------------------------------------------------------------
----------------------------------------------------------
Spree mailing list, this topic :
http://groups.google.com/group/spree-user/browse_thread/thread/4797e4...
RestfulX mailing list, this topic :
http://groups.google.com/group/restfulx-framework/browse_thread/threa...

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

* Re: How to start well for a special git construction
  2010-03-18 19:26 How to start well for a special git construction bruno le hyaric
@ 2010-03-18 20:48 ` Avery Pennarun
       [not found]   ` <e8be804e1003191231h68983d75od0ef7ec5b715e19f@mail.gmail.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Avery Pennarun @ 2010-03-18 20:48 UTC (permalink / raw)
  To: bruno le hyaric; +Cc: git

On Thu, Mar 18, 2010 at 3:26 PM, bruno le hyaric
<bruno.lehyaric@gmail.com> wrote:
> On the left hand, I use one framework : Spree ;
> on the other hand , I use Flex generation with another framework : RestfulX;
> on my third hand ^^, I want to merge both in a third directory.

I think you might have skipped past describing your problem and jumped
straight to describing your solution.

Do you actually have multiple projects that you're working on, or are
you the maintainer of an application that uses other people's
projects?  Do you want to make patches to these other subprojects
(Spree and RestfulX) and distribute them upstream, or do you just want
to use their upstream versions verbatim?  Do you want to patch their
projects and *not* distribute your patches upstream?  Do you expect to
update your copies of those projects frequently or rarely?

Are you planning to distribute copies of your source code, your
finished product, or both?  Ruby on Rails apps usually don't have
anything *but* the source code, but in that case, I'm not sure why you
mention Clearcase and not including the source code in release
streams.

There are a lot of variables here and it's hard to give good advice
unless we have a clearer understanding of what you actually want to
accomplish.

Have fun,

Avery

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

* Re: How to start well for a special git construction
       [not found]     ` <32541b131003191259j1208118ayca6c79c21cae2291@mail.gmail.com>
@ 2010-03-19 20:30       ` bruno le hyaric
  2010-03-19 20:48         ` Avery Pennarun
  0 siblings, 1 reply; 4+ messages in thread
From: bruno le hyaric @ 2010-03-19 20:30 UTC (permalink / raw)
  To: Avery Pennarun, git

Thanks for your help.
I've just created my empty new branch for delivery stuff... and
effectively the branch is empty :-D
Any idea on how I can add executable files in this empty branch from
the master branch? Is that possible?
(perhaps I'm using Git in a bad way)

If I want to manage those file with Git, it's just for the purpose to
merge them in another repository. I would have choose to have only one
repository for all things... but basically, the two frameworks are not
maid to be used together. So I thought that using two distinct
repositories was better. Especially for Restfulx code generation which
need a lot of unsalubrious hacks. I don't want to keep them in my
final application...

in any case, thank you very much for your quick answers.


Bruno

2010/3/19, Avery Pennarun <apenwarr@gmail.com>:
> On Fri, Mar 19, 2010 at 3:31 PM, bruno le hyaric
> <bruno.lehyaric@gmail.com> wrote:
>> 2010/3/18, Avery Pennarun <apenwarr@gmail.com>:
>>> Do you actually have multiple projects that you're working on, or are
>>> you the maintainer of an application that uses other people's
>>> projects?
>>
>> I'm starting building a new web application based on 2 existing
>> frameworks (Spree, RestfulX).
>
> This basic explanation leads me to believe you only really want one
> repo (at least once you have it set up): the one for your app.  Other
> people already host repos for the other projects.
>
>> I want to use latest upstream of both frameworks. For the moment I
>> don't have reason to make patches for these, but if I can do that,
>> this is better. In the other case I can imagine developping patch in
>> distinct repository in a independant way...
>
> You can embed the contents of the other repositories into yours in one
> of three ways that I know of:
>
> - Just copy the files from those libraries into your project's repo.
> This is cheap and easy, although it makes it a bit harder to push
> patches upstream later, in case you care about that.
>
> - Use git-submodule to import those libraries into your project's
> repo.  This is reasonably easy, but makes it hard to patch those
> libraries without creating additional repositories, which is
> inconvenient.  If you don't need to patch those libraries, it's the
> cleanest way.
>
> - Use git-subtree to import those libraries into your project's repo.
> This makes it relatively easy to push and pull changes from the
> libraries from/to upstream, but can clutter up your 'git log' a bit.
>
> I expect that for your purposes, any of the three options would work fine.
>
>> I plan to distribute the basic work needed by my application.
>> Basically, I'm building an automated process to get a e-commerce
>> website with generated Flex (Flash) views. This process is mainly
>> based on Git/Shell/Rake/Ruby commands.
>>
>> I won't distribute the source code of my own e-commerce website.
>>
>> But my problem wasn't about redistribution... RestfulX is a tool for
>> code generation. It needs some input and generate Flex code as output.
>> Then I compile Flex code to get a Flash executable (.swf / .swc). I
>> want to manage everything with versionning, but regarding the merge, I
>> just want to merge the executable in the destination repository, not
>> all the stuff used for code generation.
>
> It's very rare with git to commit your output files into a repository.
>  You can do it, but it's rare.  Most people just put the numbered
> binaries up in a directory on a website somewhere.  Version
> controlling binaries any other way doesn't really add anything, since
> 'git diff' and friends aren't much help, and the output files are (by
> definition) possible to reconstruct from the source code, so if you
> lose them, it's not a big deal.
>
> If you really want to do it, then you will probably want to at least
> put the output files on their own branch (as you suggest) or even into
> their own repository (so that people cloning the source repo don't
> have to download tons of binary revisions that they won't be using).
>
> Hope this helps.
>
> Have fun,
>
> Avery
>

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

* Re: How to start well for a special git construction
  2010-03-19 20:30       ` bruno le hyaric
@ 2010-03-19 20:48         ` Avery Pennarun
  0 siblings, 0 replies; 4+ messages in thread
From: Avery Pennarun @ 2010-03-19 20:48 UTC (permalink / raw)
  To: bruno le hyaric; +Cc: git

On Fri, Mar 19, 2010 at 4:30 PM, bruno le hyaric
<bruno.lehyaric@gmail.com> wrote:
> Thanks for your help.
> I've just created my empty new branch for delivery stuff... and
> effectively the branch is empty :-D
> Any idea on how I can add executable files in this empty branch from
> the master branch? Is that possible?
> (perhaps I'm using Git in a bad way)

There are fancy things you can do to create a branch containing only a
single file without checking it out.  It's a bit advanced, but it
looks something like this:

    FILENAME=path/to/file
    BASENAME=$(basename $FILENAME)
    BLOBID=$(cat $FILENAME | git hash-object --stdin -w)
    TREEID=$(printf '100644 blob %s\t%s' $BLOBID $BASENAME | git mktree)
    COMMITID=$(echo Commit Message | git commit-tree $TREEID -p
refs/heads/release-branch)
    git update-ref refs/heads/release-branch $COMMITID

A more straightforward way to do it would be to clone your repository,
and check out the release branch in your clone, then copy the file to
it and commit as you normally would.

Have fun,

Avery

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

end of thread, other threads:[~2010-03-19 20:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-18 19:26 How to start well for a special git construction bruno le hyaric
2010-03-18 20:48 ` Avery Pennarun
     [not found]   ` <e8be804e1003191231h68983d75od0ef7ec5b715e19f@mail.gmail.com>
     [not found]     ` <32541b131003191259j1208118ayca6c79c21cae2291@mail.gmail.com>
2010-03-19 20:30       ` bruno le hyaric
2010-03-19 20:48         ` Avery Pennarun

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).