Comments (3)
Thank you for the suggestion. This works great!
The library is designed to use the from and to fields along with symmetric
(optional) Consider adding a warning when not all attributes are provided (or using TypeScript typing to enforce correct usage)
from git-js.
As of version 3.21.0 (on npm now) you can get the initial commit hash with await git.firstCommit()
which will further simplify your code.
from git-js.
Hi, thanks for opening the detailed issue.
The from
and to
fields aren't intended to work as you had expected, which is why the confusion here. The library is designed to use the from
and to
fields along with symmetric
to create the either double or triple dot separated version range.
To explicitly set the bounds of the log, use rev-list
to first find the commit hash of the initial commit, then use default values in the call to git.log
const git = simpleGit({ trimmed: true });
const initialCommit = await git.raw('rev-list', '--max-parents=0', 'HEAD');
await git.log({
from: from ?? initialCommit,
to: to ?? 'HEAD',
symmetric: false,
});
from git-js.
Related Issues (20)
- how to add subtree? HOT 1
- working_dir comment HOT 1
- npm ERR! code ETARGET HOT 1
- SSH agent/socket support HOT 2
- Git Push Error 400 HOT 2
- Checking out repo using simple-git from within repo reinitializes repo even when baseDir is set HOT 2
- gpg tty on WSL HOT 1
- .env fails if not directory-owner
- No status in `diffSummary` with `--name-status` HOT 2
- How can I get parent branch name using simpleGit ? HOT 2
- Unexpected behavior of simpleGit.log when getting commit details HOT 1
- status() hangs + never returns on repository with hundreds of untracked files. HOT 2
- Error on windows when on different drive HOT 2
- [Feature Request] Git LFS support
- Ability to provide a command instead of a binary (WSL support) HOT 2
- Watch the size progress while cloning HOT 2
- git.log locks when using stat or numstat HOT 3
- Add flatpak environment support HOT 3
- Is it Possible to Use Git Commands in Subdirectories without a .git Folder? HOT 4
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 git-js.