You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Justin Georgeson <JG...@lgc.com> on 2016/06/15 14:10:42 UTC

RE: [EXTERNAL] SCM APIs cause "ref HEAD is not a symbolic ref"

Is the failure happening during CI with a shallow clone? I've seen a few systems

> -----Original Message-----
> From: simone.tripodi@gmail.com [mailto:simone.tripodi@gmail.com] On
> Behalf Of Simone Tripodi
> Sent: Tuesday, June 14, 2016 6:14 PM
> To: Maven Users List <us...@maven.apache.org>
> Subject: [EXTERNAL] SCM APIs cause "ref HEAD is not a symbolic ref"
> 
> Hi all mates,
> I've been happily using the Maven SCM APIs to perform few operations "under
> the hood" for my users, everything was working fine until stumbled in the
> SCMException "Detecting the current branch failed: fatal: ref HEAD is not a
> symbolic ref"
> The scenario is: I am using the libraries below
> 
>        <dependency>
>             <groupId>org.apache.maven.scm</groupId>
>             <artifactId>maven-scm-api</artifactId>
>             <version>${maven.scm.version}</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.maven.scm</groupId>
>             <artifactId>maven-scm-provider-gitexe</artifactId>
>             <version>${maven.scm.version}</version>
>         </dependency>
> where <maven.scm.version>1.9.4</maven.scm.version>, the sequence of
> operations that cause the error are:
> 
>             ScmVersion version = new ScmTag(version);
>             ScmResult result = scmManager.checkOut(repository, new
> ScmFileSet(appDir), version);
>             ...
>             result = scmManager.add(repository, new ScmFileSet(appDir, newFile),
> commitMessage);
>             ...
>            result = scmManager.checkIn(repository, new ScmFileSet( quickstartDir),
> version, commitMessage); The error happens when invoking the checkIn, do
> you have any recommendation on how to modify the operations sequence in
> order to make it working, when checking out a tag?
> 
> Many thanks in advance, all the best!
> -Simo
> 
> https://urldefense.proofpoint.com/v2/url?u=http-3A__people.apache.org_-
> 7Esimonetripodi_&d=CwIBaQ&c=PskvixtEUDK7wuWU-
> tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEm
> BCjCmEiTk&m=tM-
> Hfs5kq996kh6XWQPMEf0VpmT8uuezxYNm_GWNuv0&s=4ojqjCiL_L4n0-ZS5-
> nOZWuDL7KVEaCJAt4oj3oucyI&e=
> https://urldefense.proofpoint.com/v2/url?u=http-
> 3A__twitter.com_simonetripodi&d=CwIBaQ&c=PskvixtEUDK7wuWU-
> tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEm
> BCjCmEiTk&m=tM-
> Hfs5kq996kh6XWQPMEf0VpmT8uuezxYNm_GWNuv0&s=wpUd7oZEIMSyoQq2a
> t3elxk9yOkeyR4NN6GUd3K8ahs&e=

----------------------------------------------------------------------
This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient.  Any review, use, distribution, or disclosure by others is strictly prohibited.  If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org

Re: [EXTERNAL] SCM APIs cause "ref HEAD is not a symbolic ref"

Posted by Simone Tripodi <si...@apache.org>.
Hi Mark!
thanks for jumping in!

True, I am completely by your side, I'll enable my plugin to work on
branches only.
All the best!
-Simo


http://people.apache.org/~simonetripodi/
http://twitter.com/simonetripodi

On Wed, Jun 15, 2016 at 4:49 PM, Mark Prins <mc...@gmail.com> wrote:

> Op 15 jun. 2016 16:10 schreef "Justin Georgeson" <JG...@lgc.com>:
> >
> > Is the failure happening during CI with a shallow clone? I've seen a few
> systems
> >
> > > -----Original Message-----
> > > From: simone.tripodi@gmail.com [mailto:simone.tripodi@gmail.com] On
> > > Behalf Of Simone Tripodi
> > > Sent: Tuesday, June 14, 2016 6:14 PM
> > > To: Maven Users List <us...@maven.apache.org>
> > > Subject: [EXTERNAL] SCM APIs cause "ref HEAD is not a symbolic ref"
> > >
> > > Hi all mates,
> > > I've been happily using the Maven SCM APIs to perform few operations
> "under
> > > the hood" for my users, everything was working fine until stumbled in
> the
> > > SCMException "Detecting the current branch failed: fatal: ref HEAD is
> not a
> > > symbolic ref"
> > > The scenario is: I am using the libraries below
> > >
> > >        <dependency>
> > >             <groupId>org.apache.maven.scm</groupId>
> > >             <artifactId>maven-scm-api</artifactId>
> > >             <version>${maven.scm.version}</version>
> > >         </dependency>
> > >         <dependency>
> > >             <groupId>org.apache.maven.scm</groupId>
> > >             <artifactId>maven-scm-provider-gitexe</artifactId>
> > >             <version>${maven.scm.version}</version>
> > >         </dependency>
>
> > > The error happens when invoking the checkIn, do
> > > you have any recommendation on how to modify the operations sequence in
> > > order to make it working, when checking out a tag?
> > >
>
> When you check out a tag in git, the head becomes unattached, you need to
> create a branch from the tag and you can then commit to the branch, you
> should not attempt to commit to any tag.
>

RE: [EXTERNAL] SCM APIs cause "ref HEAD is not a symbolic ref"

Posted by Mark Prins <mc...@gmail.com>.
Op 15 jun. 2016 16:10 schreef "Justin Georgeson" <JG...@lgc.com>:
>
> Is the failure happening during CI with a shallow clone? I've seen a few
systems
>
> > -----Original Message-----
> > From: simone.tripodi@gmail.com [mailto:simone.tripodi@gmail.com] On
> > Behalf Of Simone Tripodi
> > Sent: Tuesday, June 14, 2016 6:14 PM
> > To: Maven Users List <us...@maven.apache.org>
> > Subject: [EXTERNAL] SCM APIs cause "ref HEAD is not a symbolic ref"
> >
> > Hi all mates,
> > I've been happily using the Maven SCM APIs to perform few operations
"under
> > the hood" for my users, everything was working fine until stumbled in
the
> > SCMException "Detecting the current branch failed: fatal: ref HEAD is
not a
> > symbolic ref"
> > The scenario is: I am using the libraries below
> >
> >        <dependency>
> >             <groupId>org.apache.maven.scm</groupId>
> >             <artifactId>maven-scm-api</artifactId>
> >             <version>${maven.scm.version}</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.apache.maven.scm</groupId>
> >             <artifactId>maven-scm-provider-gitexe</artifactId>
> >             <version>${maven.scm.version}</version>
> >         </dependency>

> > The error happens when invoking the checkIn, do
> > you have any recommendation on how to modify the operations sequence in
> > order to make it working, when checking out a tag?
> >

When you check out a tag in git, the head becomes unattached, you need to
create a branch from the tag and you can then commit to the branch, you
should not attempt to commit to any tag.

Re: [EXTERNAL] SCM APIs cause "ref HEAD is not a symbolic ref"

Posted by Simone Tripodi <si...@apache.org>.
Hi Justin!
nope, I am just using the APIs in a custom plugin implementation, I
understand anyway what you mean, thanks!!!
-Simo

http://people.apache.org/~simonetripodi/
http://twitter.com/simonetripodi

On Wed, Jun 15, 2016 at 4:10 PM, Justin Georgeson <JG...@lgc.com>
wrote:

> Is the failure happening during CI with a shallow clone? I've seen a few
> systems
>
> > -----Original Message-----
> > From: simone.tripodi@gmail.com [mailto:simone.tripodi@gmail.com] On
> > Behalf Of Simone Tripodi
> > Sent: Tuesday, June 14, 2016 6:14 PM
> > To: Maven Users List <us...@maven.apache.org>
> > Subject: [EXTERNAL] SCM APIs cause "ref HEAD is not a symbolic ref"
> >
> > Hi all mates,
> > I've been happily using the Maven SCM APIs to perform few operations
> "under
> > the hood" for my users, everything was working fine until stumbled in the
> > SCMException "Detecting the current branch failed: fatal: ref HEAD is
> not a
> > symbolic ref"
> > The scenario is: I am using the libraries below
> >
> >        <dependency>
> >             <groupId>org.apache.maven.scm</groupId>
> >             <artifactId>maven-scm-api</artifactId>
> >             <version>${maven.scm.version}</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.apache.maven.scm</groupId>
> >             <artifactId>maven-scm-provider-gitexe</artifactId>
> >             <version>${maven.scm.version}</version>
> >         </dependency>
> > where <maven.scm.version>1.9.4</maven.scm.version>, the sequence of
> > operations that cause the error are:
> >
> >             ScmVersion version = new ScmTag(version);
> >             ScmResult result = scmManager.checkOut(repository, new
> > ScmFileSet(appDir), version);
> >             ...
> >             result = scmManager.add(repository, new ScmFileSet(appDir,
> newFile),
> > commitMessage);
> >             ...
> >            result = scmManager.checkIn(repository, new ScmFileSet(
> quickstartDir),
> > version, commitMessage); The error happens when invoking the checkIn, do
> > you have any recommendation on how to modify the operations sequence in
> > order to make it working, when checking out a tag?
> >
> > Many thanks in advance, all the best!
> > -Simo
> >
> > https://urldefense.proofpoint.com/v2/url?u=http-3A__people.apache.org_-
> > 7Esimonetripodi_&d=CwIBaQ&c=PskvixtEUDK7wuWU-
> > tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEm
> > BCjCmEiTk&m=tM-
> > Hfs5kq996kh6XWQPMEf0VpmT8uuezxYNm_GWNuv0&s=4ojqjCiL_L4n0-ZS5-
> > nOZWuDL7KVEaCJAt4oj3oucyI&e=
> > https://urldefense.proofpoint.com/v2/url?u=http-
> > 3A__twitter.com_simonetripodi&d=CwIBaQ&c=PskvixtEUDK7wuWU-
> > tIg6oKuGYBRbrMXk2FZvF0UfTo&r=dLxYM3PBhAqFnkH7uKz_OVZL1uyui4QoEm
> > BCjCmEiTk&m=tM-
> > Hfs5kq996kh6XWQPMEf0VpmT8uuezxYNm_GWNuv0&s=wpUd7oZEIMSyoQq2a
> > t3elxk9yOkeyR4NN6GUd3K8ahs&e=
>
> ----------------------------------------------------------------------
> This e-mail, including any attached files, may contain confidential and
> privileged information for the sole use of the intended recipient.  Any
> review, use, distribution, or disclosure by others is strictly prohibited.
> If you are not the intended recipient (or authorized to receive information
> for the intended recipient), please contact the sender by reply e-mail and
> delete all copies of this message.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>