Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

separating commit messages between modules of a monorepo

Tags:

git

lerna

I have a fullstack project like this:

myProject
    packages
        myProjectCommon
        myProjectFrontEndApp1
        myProjectFrontEndApp2
        myProjectBackEnd

I use Lerna so that I can use myProjectCommon as an internal dependency.

If I decide to do a monorepo, I would do something like this:

myProject
.git
    packages
        myProjectCommon
        myProjectFrontEndApp1
        myProjectFrontEndApp2
        myProjectBackEnd

A major problem that I see with this, is that I will be mixing the commit history of all my packages together.

Is this configuration, is there a tool that would allow me to look at the commit history for a particular package ?

Or is the best solution to do separate repos for each package, and use them as git submodules like this :

myProject
.git
.gitmodules
    packages
        myProjectCommon
            .git
        myProjectFrontEndApp1
            .git
        myProjectFrontEndApp2
            .git
        myProjectBackEnd
            .git
like image 880
Lev Avatar asked Apr 01 '17 12:04

Lev


1 Answers

git log <glob> will work. For example: git log packages/myProjectBackEnd will show only the commits changing files in that module

like image 133
DSPC Avatar answered Sep 18 '22 06:09

DSPC