-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update commit log when a git action has occurred
When a commit happens or pull the log will update in the scm view. #3
- Loading branch information
Showing
6 changed files
with
85 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,10 @@ | |
"name": "Richard Kotze", | ||
"email": "[email protected]" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/rkotze/git-ease.git" | ||
}, | ||
"homepage": "https://github.com/rkotze/git-ease/blob/trunk/README.md", | ||
"bugs": { | ||
"url": "https://github.com/rkotze/git-ease/issues" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import * as fs from "fs"; | ||
import * as path from "path"; | ||
import { window } from "vscode"; | ||
import { GitExt } from "../vscode-git-extension/git-ext"; | ||
|
||
export function watchForCommit(cb: Function): fs.FSWatcher | undefined { | ||
const gitExt = new GitExt(); | ||
const gitCommit = path.join(gitExt.rootPath || "", ".git"); | ||
|
||
try { | ||
return fs.watch(gitCommit, function (evt, filename) { | ||
if (filename) { | ||
if (debounceFsWatch()) { | ||
return; | ||
} | ||
cb(evt); | ||
} | ||
}); | ||
} catch (err) { | ||
window.showErrorMessage("Watch for commit failed!: " + err.message); | ||
} | ||
} | ||
|
||
let fsWait: boolean | NodeJS.Timeout = false; | ||
function debounceFsWatch() { | ||
if (fsWait) { | ||
return true; | ||
} | ||
fsWait = setTimeout(() => { | ||
fsWait = false; | ||
}, 1000); // windows is a bit slower | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters