Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java/JGit:如何在不影响某些目录的情况下获得Git提交?_Java_Git_Jgit - Fatal编程技术网

Java/JGit:如何在不影响某些目录的情况下获得Git提交?

Java/JGit:如何在不影响某些目录的情况下获得Git提交?,java,git,jgit,Java,Git,Jgit,使用Git,我可以通过以下命令获得影响路径的提交: 我还可以获得目录中未发生的提交(根据此处的SO答案:): JGit是Git的Java实现,它提供了log命令的实现,但是它只提供了前一个(包含)log命令的变体,而不是独占版本(): 有没有一种方法可以让我使用Java获得不影响路径的提交列表(例如,git log--.:(exclude)sub“),而不需要我向git本身付费?我不确定这是否可行,因此我通过Gerrit向JGit项目提交了一份PR: # show commits affecti

使用Git,我可以通过以下命令获得影响路径的提交:

我还可以获得目录中未发生的提交(根据此处的SO答案:):

JGit是Git的Java实现,它提供了log命令的实现,但是它只提供了前一个(包含)log命令的变体,而不是独占版本():


有没有一种方法可以让我使用Java获得不影响路径的提交列表(例如,
git log--.:(exclude)sub“
),而不需要我向
git
本身付费?

我不确定这是否可行,因此我通过Gerrit向JGit项目提交了一份PR:
# show commits affecting the `sub` directory
git log -- . "sub"
git log -- . ":(exclude)sub"
git log -- . ":!sub"
git log -- . ":^sub"
public LogCommand addPath(String path)
// Show only commits that affect any of the specified paths. The path must either name a file or a directory exactly and use / (slash) as separator. Note that regex expressions or wildcards are not supported.

Parameters:
    path - a repository-relative path (with / as separator)

Returns:
    this