Comments (7)
merged & published
from gr.
I too have found myself wishing this would work with submodules. I believe it can be made to work pretty easily. All that seemingly needs to change is this function. Just need to check if the parent directory has a .gitmodules file, and a .git directory. I will try and submit a PR with these changes.
git: function(req) {
var stat;
try {
stat = fs.statSync(req.path + '/.git/');
if (stat.isDirectory()) {
return true;
}
} catch (e) { }
if (req.format === 'human') {
console.log('Skipped ' + req.path + ' as it does not have a .git subdirectory.');
}
return false;
},
from gr.
Hey, super. Thanks very much for that.
from gr.
It works if the submodule is the first child of the root directory but not works if the submodule is in foo/more/than/one/level/bar
. I don't speak Java, but I know that some kind of globbing should do the trick here, or a loop like:
while !empty(req.path) {
var parentPath = path.dirname(req.path);
try {
stat = fs.statSync(parentPath + '/.gitmodules');
if (!stat.isFile()) {
var req.path = removeLastPart(req.path);
}
} catch (e) { }
}
return empty(req.path) ? false : true;
from gr.
Another option: if .git
is a file instead of a directory (so it's a submodule), then read the contents, for example:
gitdir: ../../../../.git/more/than/one/level/bar
If it contains gitdir:
than it's a submodule.
from gr.
Please help me in #65
from gr.
Just finished #65, please test it.
from gr.
Related Issues (20)
- Can command execution for a tag be ordered, this can be based on the order in the .grconfig.json?
- gr shell
- Does it able to get contribution stats like code line stats, sothat can be generated to json file or html?
- Export to `.code-workspace` for VC Code use HOT 1
- gr alternative
- gr tag discover does not work HOT 1
- Removing a tag from a repo that doesn't have the tag removes the tag from another random repo
- Unable to interact with subprocesses; create "interactive run" feature
- Check config format, add a useful message HOT 1
- `gr status` causes TypeError: Cannot read property 'toString' of null HOT 2
- Support XDG Base Directory Specification #1316
- Broken list for specific tags HOT 1
- Cannot run bash/zsh functions or aliases HOT 2
- strict mode
- Really missing the `@modified` type functionality mentioned in the README HOT 2
- Tags are not respected in powershell
- doesn't output completion script HOT 2
- Can we use this tool on windows?
- Tag union/intersection
- Run gr in parallel when multiple folder in a group, yet still output sequentially
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gr.