jgit

When I use a RevFilter, my RevWalk isn't selecting any commits

[亡魂溺海] 提交于 2020-02-02 16:31:08
问题 I'm using jGit to walk over the commits in a repository. When I use the RevWalk class by itself, I get back all of the commits in the repository. When I use revWalk.setFilter() to add a filter, though, I no longer get any commits whatsoever, even though I know for sure that commits exist that match my filter's criteria. Here is my code: RevWalk walk = new RevWalk(repo); // These two lines give me trouble: // RevFilter filter = CommitTimeRevFilter.between(sinceDate, untilDate); // walk

When I use a RevFilter, my RevWalk isn't selecting any commits

生来就可爱ヽ(ⅴ<●) 提交于 2020-02-02 16:31:06
问题 I'm using jGit to walk over the commits in a repository. When I use the RevWalk class by itself, I get back all of the commits in the repository. When I use revWalk.setFilter() to add a filter, though, I no longer get any commits whatsoever, even though I know for sure that commits exist that match my filter's criteria. Here is my code: RevWalk walk = new RevWalk(repo); // These two lines give me trouble: // RevFilter filter = CommitTimeRevFilter.between(sinceDate, untilDate); // walk

When I use a RevFilter, my RevWalk isn't selecting any commits

╄→гoц情女王★ 提交于 2020-02-02 16:30:15
问题 I'm using jGit to walk over the commits in a repository. When I use the RevWalk class by itself, I get back all of the commits in the repository. When I use revWalk.setFilter() to add a filter, though, I no longer get any commits whatsoever, even though I know for sure that commits exist that match my filter's criteria. Here is my code: RevWalk walk = new RevWalk(repo); // These two lines give me trouble: // RevFilter filter = CommitTimeRevFilter.between(sinceDate, untilDate); // walk

Get submodule hash from bare repository

筅森魡賤 提交于 2020-01-24 11:28:50
问题 We have a gitolite server with our customers custom apps. Every app has a submodule "repository/core" which refers to our base app. We would now like to create a dashboard which shows all our customers apps and at which revision there core is at. gitolite stores everything in bare repositories on disk and the dashboard app has direct access to the repos / or using ssh keys if that's easier. My question is how would I from a bare repository find out what revision a submodule is at, and who

.pack file from git repo can't be deleted using File delete() method

我的未来我决定 提交于 2020-01-23 01:08:30
问题 For this method I am writing, I am cloning a git repo using the jgit library, then doing some stuff with those files, then finally I want to delete the repo. The problem I'm having is that when I call the delete() method on a .pack file (located in .git\objects\pack), it can't be deleted. All other files can be deleted though. Why does this happen? 回答1: You can see that Java apps based on JGit have a tendency to disble ddd by default. See this config file for Gitblit for instance: # When true

JGit push does not update files

倖福魔咒の 提交于 2020-01-16 19:01:47
问题 I've been searching about this topic for a few days now and I can't get a solution. I've looked at this topic too: StackOverflow How to push JGit The problem is I'm doing a program that should be a github with only the very basic functions, but when I do a push commit messages works fine but if I change the content of some files it does not update on the remote repository. I use this for commit: Repository localRepo = new FileRepository(repository + "\\.git"); Git git = new Git(localRepo);

JGit Check if a branch is checked out

拟墨画扇 提交于 2020-01-13 11:52:44
问题 I am working on a project using JGit. I managed to delete a branch, but I also want to check if that branch is checked out or not. I found a variable in CheckoutCommand but it is private: private boolean isCheckoutIndex() { return startCommit == null && startPoint == null; } No public method returns what I want. When I use the command below on a checked out branch it returns an error that the branch cannot be deleted, so I want to check first if is checked out or not. git.branchDelete()

eclipse: “re-indexing repository workspace” or “Computing Git status for repository workspace”

一世执手 提交于 2020-01-13 10:16:30
问题 I am using eclipse Juno, and yesterday I noticed my computer was getting very hot. I checked the CPU usage to see it was at 100%. Eclipse was the culprit, busy "re-indexing repository workspace". When after half an hour it hadn't finished and my machine was nearly melting, I searched and found these similar problems: Re-indexing repository loop - not Maven Eclipse hangs on "Re-indexing (fully) repository {username}" Thing is I'm not using git. And by the sounds of things I don't want to since

Egit hooks do not get triggered

吃可爱长大的小学妹 提交于 2020-01-09 03:49:06
问题 I have a git repo with a pre-commit hook that intentionally fails 100% of the time. cat .git/hooks/pre-commit > exit 1 If I try to commit through the command line, it fails as expected. However, if I commit from egit, the hook is ignored and the changes get committed. Does egit/jgit not recognize hooks yet? Is there a workaround for this? Thanks in advance! 回答1: (Original answer: June 2011) MatrixFrog correctly points out to the bug 299315, which mentions those hooks aren't supported yet. You

Pushing files to remote repository using jGit

社会主义新天地 提交于 2020-01-06 07:21:08
问题 I need to programattically push files using jGit from different local repositories to one remote repository hosted on Github. The code below works with no exceptions, but nothing is being changed in Github. Every user defined 'group' in my program has its own folder under another folder called data. And every group folder contains a folder called repo, which contains an html and css file. When the time's right, I need to push these two files to github. Here's the structure of the folders: