Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » InternalException: combination of --all and --only not allowed(error in basic functionality)
InternalException: combination of --all and --only not allowed [message #1420963] Wed, 10 September 2014 18:59 Go to next message
René Jansen is currently offline René JansenFriend
Messages: 7
Registered: September 2014
Junior Member
I was trying out jgit on z/OS. The self contained .sh is of no great use because I have to upload class files untranslated while the script source needs conversion to EBCDIC. I removed the script part and used the .jar file with a command line. When I got stuck with the following problem, I retried the same approach on MacOSX and saw it fail in the same way. This is with 3.4.1: jgit version 3.4.1.201406201815-r

AB2217:/u/ab2217/testjgit: >jgit commit -m 'first test' --all
org.eclipse.jgit.api.errors.JGitInternalException: The combination of arguments --all and --only is not allowed
at org.eclipse.jgit.api.CommitCommand.setAll(CommitCommand.java:648)
at org.eclipse.jgit.pgm.Commit.run(Commit.java:96)
at org.eclipse.jgit.pgm.TextBuiltin.execute(TextBuiltin.java:209)
at org.eclipse.jgit.pgm.Main.execute(Main.java:223)
at org.eclipse.jgit.pgm.Main.run(Main.java:124)
at org.eclipse.jgit.pgm.Main.main(Main.java:98)

this is after a 'jgit init', 'jgit add *.nrx', 'jgit commit -a -m 'first commit'. The commit fails on this internal error. A 'jgit log' shows the commit, but not subsequent commits. Can someone help?
z/OS java is IBM's 1.6, 31 bit version. MacOSX is Oracle Java 1.8.0_20 b13, although the error is the same so that might be insignificant.

Many thanks in advance.

René Vincent Jansen.
Re: InternalException: combination of --all and --only not allowed [message #1421301 is a reply to message #1420963] Thu, 11 September 2014 07:29 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
this should only happen if you explicitly give the option --only or set path(s) in the commit command you issue

[testjgit (master)]$ jgit commit -h

jgit commit [paths ...] [--all (-a)] [--amend] [--author AUTHOR] [--help (-h)] --message (-m) message [--only (-o)]

paths : see --only
--all (-a) : commit all modified and deleted files
--amend : Amend the tip of the current branch
--author AUTHOR : Override the author name used in the commit. You can u
se the standard A U Thor <author@example.com> format.
--help (-h) : display this help text
--message (-m) message : Use the given <msg> as the commit message
--only (-o) : commit specified paths only
Re: InternalException: combination of --all and --only not allowed [message #1421310 is a reply to message #1421301] Thu, 11 September 2014 07:40 Go to previous messageGo to next message
René Jansen is currently offline René JansenFriend
Messages: 7
Registered: September 2014
Junior Member
thanks for your quick answer; I did neither - not specify a path, nor using --all or --only. So, how can I debug this?
Re: InternalException: combination of --all and --only not allowed [message #1421340 is a reply to message #1421310] Thu, 11 September 2014 08:34 Go to previous messageGo to next message
Christian Halstrick is currently offline Christian HalstrickFriend
Messages: 274
Registered: July 2009
Senior Member
why do you want to specify '-a'? Anything wrong with the traditional 'jgit commit -m 'first commit'. You told git already with your "git add" commands which files should be modified in the next commit. You only specify '-a' if you are too lazy to fire the explicit 'git add' commands and want git to include even modified files which you have not explicitly added with "git add".

Ciao
Chris
Re: InternalException: combination of --all and --only not allowed [message #1421379 is a reply to message #1421340] Thu, 11 September 2014 09:39 Go to previous messageGo to next message
René Jansen is currently offline René JansenFriend
Messages: 7
Registered: September 2014
Junior Member
The reason is simple: after years of subversion I am used to a commit that commits everything. "Too lazy" might be a factor but (1) this works in native git and (2) it avoids me forgetting to "git add".
Your point is well taken but I'am afraid it is academic: it also fails without the -a :
Fifi:testjgit rvjansen$ jgit commit -m 'second commit'
org.eclipse.jgit.api.errors.JGitInternalException: The combination of arguments --all and --only is not allowed
at org.eclipse.jgit.api.CommitCommand.setAll(CommitCommand.java:648)
at org.eclipse.jgit.pgm.Commit.run(Commit.java:96)
at org.eclipse.jgit.pgm.TextBuiltin.execute(TextBuiltin.java:209)
at org.eclipse.jgit.pgm.Main.execute(Main.java:223)
at org.eclipse.jgit.pgm.Main.run(Main.java:124)
at org.eclipse.jgit.pgm.Main.main(Main.java:98)
Fifi:testjgit rvjansen$
Re: InternalException: combination of --all and --only not allowed [message #1421502 is a reply to message #1421379] Thu, 11 September 2014 13:00 Go to previous messageGo to next message
René Jansen is currently offline René JansenFriend
Messages: 7
Registered: September 2014
Junior Member
I thought I'd have a look around myself and I cloned the jgit repository to build the code. However, mvn clean install fails:
[INFO] JGit - Core ....................................... FAILURE [54.140s]
[INFO] JGit - Ant Tasks .................................. SKIPPED
[INFO] JGit Archive Formats .............................. SKIPPED
[INFO] JGit - AWT User Interface ......................... SKIPPED
[INFO] JGit - Apache httpclient based HTTP support ....... SKIPPED
[INFO] JGit - HTTP Server ................................ SKIPPED
[INFO] JGit - Core Java7 Support ......................... SKIPPED
[INFO] JGit - Console User Interface ..................... SKIPPED
[INFO] JGit - Command Line Interface ..................... SKIPPED
[INFO] JGit - JUnit Utility Classes ...................... SKIPPED
[INFO] JGit - JUnit Http Utility Classes ................. SKIPPED
[INFO] JGit - Core Tests ................................. SKIPPED
[INFO] JGit - Ant Tasks Tests ............................ SKIPPED
[INFO] JGit - HTTP Tests ................................. SKIPPED
[INFO] JGit - Command Line Interface Tests ............... SKIPPED
[INFO] JGit - Core Java 7 Tests .......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:15.174s
[INFO] Finished at: Thu Sep 11 14:52:52 CEST 2014
[INFO] Final Memory: 28M/205M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.9.1:jar (attach-javadocs) on project org.eclipse.jgit: MavenReportException: Error while creating archive:
[ERROR] Exit code: 1 - /Users/rvjansen/apps/jgit/org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java:115: warning: no description for @param
[ERROR] * @param f
[ERROR] ^
[ERROR] /Users/rvjansen/apps/jgit/org.eclipse.jgit/src/org/eclipse/jgit/api/AddCommand.java:88: warning: no description for @param
[ERROR] * @param repo
[ERROR] ^
[ERROR] /Users/rvjansen/apps/jgit/org.eclipse.jgit/src/org/eclipse/jgit/api/AddNoteCommand.java:113: warning: no description for @param
[ERROR] * @param id
[ERROR] ^
[ERROR] /Users/rvjansen/apps/jgit/org.eclipse.jgit/src/org/eclipse/jgit/api/AddNoteCommand.java:78: warning: no description for @param

javac is javac 1.8.0_20-ea
repo is:
Fifi:jgit rvjansen$ git remote -v
origin git://git.eclipse.org/gitroot/jgit/jgit.git (fetch)
origin git://git.eclipse.org/gitroot/jgit/jgit.git (push)

what am I doing wrong?
Re: InternalException: combination of --all and --only not allowed [message #1421808 is a reply to message #1421502] Thu, 11 September 2014 23:26 Go to previous messageGo to next message
René Jansen is currently offline René JansenFriend
Messages: 7
Registered: September 2014
Junior Member
well, I disabled javadoc and built it. With this 3.6.0 version same problem. It occurs when a newly created repository receives the first commit with -a -m, after the files already have been added with jgit add and there has been no other change.

This is not consistent with git. Moreover, there is another inconsistency problem in that repetitive commits keep on committing instead of just seeing that nothing changed and then exiting. Now probably someone will say that I should not do that, but for the moment I cannot really let this loose on beginners who are going to do lord-knows-what after doing single-lane Endevor for 25 years and more.

I am now torn between trying to build native git on z/OS (with all the EBCDIC issues that will yield) or filing issues for this CLI interface and hope they will be fixed rather quickly.
Re: InternalException: combination of --all and --only not allowed [message #1422014 is a reply to message #1421808] Fri, 12 September 2014 07:35 Go to previous messageGo to next message
Christian Halstrick is currently offline Christian HalstrickFriend
Messages: 274
Registered: July 2009
Senior Member
Regarding "jgit commit" producing empty commits: Yes, you are right. The jgit command line always works like the native git "git commit --allow-empty". Jgit simply doesn't check whether a commit is empty or not. That could be fixed.

Regarding your initial problem that "jgit -a -m ..." produces unexpected error messages. This problem is platform dependent. On a linux box (and on windows) it behaves correctly. See here:

/tmp> wget -q -O jgit.sh https://repo.eclipse.org/content/groups/releases//org/eclipse/jgit/org.eclipse.jgit.pgm/3.4.1.201406201815-r/org.eclipse.jgit.pgm-3.4.1.201406201815-r.sh
/tmp> chmod +x ./jgit.sh 
/tmp> mkdir test
/tmp> cd test
/tmp/test> ../jgit.sh init
Initialized empty Git repository in /tmp/test/./.git
/tmp/test> touch a
/tmp/test> ../jgit.sh add a
/tmp/test> ../jgit.sh commit -a -m addA
[master dafe31d240865c0d7dfdda9d7fc659b020fe310d] addA
/tmp/test>


Sadly I don't have a z/OS platform here and therefore can't see the bug.

But I have a guess. Maybe you simply quoted "first test" wrong. Imagine you would specifiy "jgit.sh -m first test --all" (you forgot to put quotes around "first test"). Then I see the same error coming up. Jgit thinks the commit message should be "first" and that you only want a commit for path "test". This path definition together with --all leads to the error message.

Can you change your command to "jgit commit -m firstTest --all". If that works
then you would have to lookup how on z/OS you have to quote command line arguments containing spaces. Maybe there is something wrong with jgit coding regarding handling quoted arguments on your platform. But I can't help since I don't have this platform


Ciao
Chris
Re: InternalException: combination of --all and --only not allowed [message #1422473 is a reply to message #1421808] Fri, 12 September 2014 22:48 Go to previous messageGo to next message
Robin Rosenberg is currently offline Robin RosenbergFriend
Messages: 332
Registered: July 2009
Senior Member
René Jansen skrev 2014-09-12 01.26:
> well, I disabled javadoc and built it. With this 3.6.0 version same problem. It occurs when a newly created repository receives the first commit with -a -m, after the files
> already have been added with jgit add and there has been no other change.
>
> This is not consistent with git. Moreover, there is another inconsistency problem in that repetitive commits keep on committing instead of just seeing that nothing changed
> and then exiting. Now probably someone will say that I should not do that, but for the moment I cannot really let this loose on beginners who are going to do
> lord-knows-what after doing single-lane Endevor for 25 years and more.
>
> I am now torn between trying to build native git on z/OS (with all the EBCDIC issues that will yield) or filing issues for this CLI interface and hope they will be fixed
> rather quickly.

Don't just hope for someone else to just fix EBCDIC issues. I don't know of any JGit developer working on, or even have access to z/OS, OpenVMS or other "exotic" environments.

You are welcome to submit EBCDIC related patches if they don't complicate JGit too much.

-- robin
Re: InternalException: combination of --all and --only not allowed [message #1692769 is a reply to message #1422014] Fri, 17 April 2015 19:52 Go to previous messageGo to next message
René Jansen is currently offline René JansenFriend
Messages: 7
Registered: September 2014
Junior Member
We are in a POC so I had to resolve this. Let me explain what happened. As the jgit.sh script had to be uploaded in binary, I had to split off the script part and run with the jar. Otherwise, the script part would have been translated to EBCDIC (good) but the jar file behind it also (bad).

The problem I had with the arguments were caused by the argument array being split up over spaces. I tested with comments of at least two words, as I am used to. This failed, with the mentioned exception, on all platforms except windows.

After some thorough but tiresome debugging, it turned out that args4j exactly does what is needed. It was the shell script that I started jgit with, that dropped the ball, on every Unix I tried it on, including z/OS.

Some wise comment googled stated you should not start java classes with scripts on Unix. I now start it with an alias defined in my .profile:

alias jgit="java org.eclipse.jgit.pgm.Main"

All is well, and two-word comments are working now, and do not complain about --only and -all. The next issue is jgit diff, which yields garbage on z/OS instead of patches. I'll make a separate posting.
Re: InternalException: combination of --all and --only not allowed [message #1703342 is a reply to message #1692769] Thu, 30 July 2015 18:58 Go to previous messageGo to next message
Andrew Shor is currently offline Andrew ShorFriend
Messages: 1
Registered: July 2015
Junior Member
René Jansen wrote on Fri, 17 April 2015 19:52

Some wise comment googled stated you should not start java classes with scripts on Unix. I now start it with an alias defined in my .profile:
alias jgit="java org.eclipse.jgit.pgm.Main"


Greetings! Could You please explain it providing more detail? I was unable to find the same wise comment as You did. Does that alias setting solve the problem, or is this only a part of solution? How your command line looks like? I do the same kind of task on IBM System i and run into the same problem with multiline comments when use jgit from shell scripts in QShell:
org.eclipse.jgit.api.errors.JGitInternalException: The combination of arguments --all and --only is not allowed

jgit.sh commit -m 'Just test'

I use JDK6 and tested on jgit 3.5.1 and 3.7.1 on IBM J9 java machine. I suppose IBM integrates the same AIX and java part into their mainframes///
Re: InternalException: combination of --all and --only not allowed [message #1703445 is a reply to message #1703342] Fri, 31 July 2015 15:29 Go to previous message
René Jansen is currently offline René JansenFriend
Messages: 7
Registered: September 2014
Junior Member
Yes, the alias as shown makes that problem go away. If I remember where I found the reference to it I'll provide it here. Also, I will have some z/OS experiences to share soon.
Previous Topic:committing single files with jgit/API
Next Topic:List conflicts prior to pull or merge
Goto Forum:
  


Current Time: Thu Apr 25 16:29:02 GMT 2024

Powered by FUDForum. Page generated in 0.03811 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top