Regarding unable to commit the changes in local repository.



  • Hi,

    I have made the changes and want to commit to local repository Git and if i select the modified changes and try to click to commit, the pushbutton is not enabled, commit pushbutton is disabled .
    I can see the difference in diif selected files, what the changes i have done in Qt source code.

    Please Guidance is required.

    Thanks,


  • Lifetime Qt Champion

    Hi,

    Where are you calling git from ? Qt Creator ? Command line ?



  • I am calling from Qt creator.


  • Lifetime Qt Champion

    Silly question but is git correctly configured in Qt Creator ?



  • @SGaist

    I followed Configuring the git from Qt Contribution guidelines.
    and followed the same. And i have made the documentation. below is the steps. Is their any mistake while configuring the Git. Please let me know if i am missing any steps or commands.?

    Configuring the Git

       download the git if it is not installed in your system using the command : sudo apt-get git install
    
    1) We need to have all files in the repository , so type the below command.
    
       git config --global core.autocrlf input
    
    2) We need to provide commitor information correctly, so that we can commit and push it to server.
    
    3) Dont use nick names, provide the specific names which was provided for Gerrit account.
    
    4) Gerrit will not accept the commits unless the committer information matches the email address(es) you registered. 
    
    5) Below are the commands to be provided.
    
       git config --global user.name "username"                             // within the double quotes provide username, provided 												   to Gerrit
    
       git config --global user.email "emailid"				// within the double quotes provide email, provided 												   to Gerrit
    
    
    6) It is necessary to install Qt commit message template , the command is provided below:
    
        git config --global commit.template
    
    7) It is necessary to show git in git stat or git commit, the command is provided below.
    
        git config --global status.showuntrackedfiles all
    
    8) git push will push all branches to the upstream repository, which is almost never what user want. the command is provided below to 		    fix this.
    
        git config --global push.default tracking
    
    9) Conflicts has to be resolved, git does not provide the by default , so the command is provided below.
    
        git config --global rerere.enabled true
        git config --global rerere.autoupdate true
    
    10) git pull will provide changes from upstream, but it is not provdided by default ,the below command is used for that.
    
        git config --global rebase.stat true
    
    11) to provide the colour patches for the differences , provide the below command.
    
        git config --global color.ui auto
        git config --global core.pager "less -FRSX"	
    
    12) Git also support alias and the command is provided below.
    
        git config --global alias.di diff
        git config --global alias.ci commit
        git config --global alias.co checkout
        git config --global alias.ann blame
    

    Thanks,
    git config --global alias.st status



  • Silly question but did you stage the files to commit?

    Try using a GUI client just for git ( https://git-scm.com/download/gui/linux ). I use Git Extensions (but I run Windows)



  • May i know what is stage the files to commit?.


  • Moderators

    @Pradeep-Kumar git add FILE



  • git status will also tell you what is staged and what isn't



  • i used git status command and it showed me list which was not staged and
    as @jsulm said i used git add filenames which i modified.



  • Then you are done, just call git commit



  • k i will use the command git commit.
    But is their any wrong in the above document which i posted?.



  • *** Suspicious changes in commit HEAD ( filepath):


    *** - Suspicious author real name (key "email")


    *** commit message:
    *** - Hint: Aim for shorter summaries


    *** examples/sql/doc/src/cachedtable.qdoc:
    *** - Style issues (key "style")
    *** 53: Trailing whitespace
    *** 54: Trailing whitespace


    *** See http://wiki.qt.io/Early_Warning_System for explanations.



  • I found this messages after i used git command , where i provided the information.
    What does it represent.


  • Lifetime Qt Champion

    Check the configuration of git particularly the email and name you provided.

    The first line of your commit is too long. IIRC It shouldn't be more than 72 character.

    The long version of the commit message should be below after one empty line. Note that the line length is still a rule to be followed.

    Remove all useless whitespaces you added on lines 53 and 54 of from cachedtale.qdoc



  • I used the command to check git config --list, below was the contents.

    core.autocrlf=input
    core.pager=less -FRSX
    status.showuntrackedfiles=all
    push.default=tracking
    rerere.enabled=true
    rerere.autoupdate=true
    rebase.stat=true
    color.ui=auto
    alias.di=diff
    alias.ci=commit
    alias.co=checkout
    alias.ann=blame
    alias.st=status
    user.email=pradeepkm186@gmail.com
    user.name=pradeep_kumar.m

    Is the configuration wrong?.


  • Lifetime Qt Champion

    The name is wrong. It's not a "username". When you contribute to Qt it should match the name you used for the Gerrit account. In your case, likely "Pradeep Kumar".



  • Username pradeep_kumar.m
    Full Name Pradeep Kumar.M
    Email Address pradeepkm186@gmail.com

    this is from Gerrit account.



  • @SGaist

    Commit button is enabled , it was parsing i had to wait for a while.
    sorry was being impatient.

    Another query is i am getting the below error

    Cannot commit 1 file(s):
    *** Please tell me who you are.

    Run

    git config --global user.email "you@example.com"
    git config --global user.name "Your Name"

    to set your account's default identity.
    Omit --global to set the identity only in this repository.

    fatal: unable to auto-detect email address (got 'pradeep@pthinks.(none)')

    Please provide further guidance?.
    Thanks,


  • Lifetime Qt Champion

    Did you forgot the extension after @pthinks ?



  • nope i have given gmail account

    git config --global user.name "pradeep_kumar.m"
    git config --global user.email "pradeepkm186@gmail.com"

    but still y it is not working?.
    its taking 'pradeep@pthinks.(none) by default. i have no clue from where.


  • Lifetime Qt Champion

    For the name it's not pradeep_kumar.m it Pradeep Kumar.M.

    As for the email, you have to reset the author of the commit since it was originally done with your other data.



  • @SGaist

    i will give Pradeep Kumar.M as username

    As for the email, you have to reset the author of the commit since it was originally done with your other data
    but second solution i didnt get it , will u please elaborate.


  • Lifetime Qt Champion

    Look at the git commitdocumentation for amend and reset-author



  • guys can u help me out, unknowingly using the command git rm has removed the files from qt source code. how can i get the removed files?.


  • Lifetime Qt Champion

    See this post.

    Searching for undo git rm would have gotten you the answer faster.



  • I have two queries

    1. regarding the Local Setup
      Host codereview.qt-project.org
      Port 29418
      User <pradeep_kumar.m>
      IdentityFile <~/.ssh/id_rsa_keynamehere>

    is this the correct information in config file.?.

    1. as i have gmail id for all 3 accounts, forum account, gerrit account,bugreports account, for corporate profile do we need to register with company id.?. is that giving me the problem. I am asking the question because i used

    git config --global user.name "pradeep_kumar.m"
    git config --global user.email "pradeepkm186@gmail.com"

    for configuring , but getting the below error and the fatal error shown in bold.?.

    Commit button is enabled , it was parsing i had to wait for a while.
    sorry was being impatient.

    Another query is i am getting the below error

    Cannot commit 1 file(s):
    *** Please tell me who you are.

    Run

    git config --global user.email "you@example.com"
    git config --global user.name "Your Name"

    to set your account's default identity.
    Omit --global to set the identity only in this repository.

    fatal: unable to auto-detect email address (got 'pradeep@pthinks.(none)')


  • Lifetime Qt Champion

    Again: user.nameis not a username it is your name
    You have to get the author of the commit correctly also.

    AFAIU, your account is registered with your pthink email so use that one for your commits.

    If you have several projects on your computer and that you are using different identities to handle them, then configure git locally by project.



  • k @SGaist i will change the user name and use my company id Pthinks id,

    and was the information correct in Config file?.


  • Lifetime Qt Champion

    Which config file is it exactly ?



  • config file where we will configure for Local setup

    1. Regarding the Local Setup

      Host codereview.qt-project.org
      Port 29418
      User <pradeep_kumar.m>
      IdentityFile <~/.ssh/id_rsa_keynamehere>

    where we will create config file in .ssh path.
    The information in config file, Host, Port, User and IdentityFile isit correct?.


  • Lifetime Qt Champion

    Remove the < and > characters and replace id_rsa_keynameherewith the correct id_rsa file name.



  • I changed the config file

    Host codereview.qt-project.org
    Port 29418
    User Pradeep Kumar.M
    IdentityFile ~/.ssh/id_rsa

    And if i try to commit again i am getting the below error.

    Cannot commit 1 file(s):
    *** Please tell me who you are.

    Run

    git config --global user.email "you@example.com"
    git config --global user.name "Your Name"

    to set your account's default identity.
    Omit --global to set the identity only in this repository.

    I changed the user name and still did i miss anything?.


  • Lifetime Qt Champion

    In that config file it's your username that you should provide.

    For the user.name it's your name as in your identity card name.



  • Its the same name Pradeep Kumar.M

    can u tell me how to configure the git step by step. so it will help me , i do know what mistake i did and how to trace it?. solution will help me.


  • Lifetime Qt Champion

    You have detailed guides in the wiki:



  • Hi,

    It will be the repeatation, but still provide the information where i missed, sorry for asking again and again, the same questions. But i am not getting , in my previous post under this topic i have provided the steps which i followed. is it correct?. Because one step is pending to commit, i am trying my best to understand what is wrong. As you @SGaist told i will once again follow and repeat the procedure.


  • Moderators

    @Pradeep-Kumar said in Regarding unable to commit the changes in local repository.:

    I used the command to check git config --list, below was the contents.

    Can you call this command again and post the latest contents? (Make sure you are in your project folder when you call the command)



  • I used the command , and i am in project folder.

    Below are the contents.

    root@pthinks:~/qt5# git config --list
    core.autocrlf=input
    core.pager=less -FRSX
    status.showuntrackedfiles=all
    push.default=tracking
    rerere.enabled=true
    rerere.autoupdate=true
    rebase.stat=true
    color.ui=auto
    alias.di=diff
    alias.ci=commit
    alias.co=checkout
    alias.ann=blame
    alias.st=status
    user.email=pradeepk@pthinks.com
    user.name=Pradeep Kumar.M
    core.repositoryformatversion=0
    core.filemode=true
    core.bare=false
    core.logallrefupdates=true
    remote.origin.url=git://code.qt.io/qt/qt5.git
    remote.origin.fetch=+refs/heads/:refs/remotes/origin/
    branch.5.7.remote=origin
    branch.5.7.merge=refs/heads/5.7
    submodule.qt3d.url=git://code.qt.io/qt/qt3d.git
    submodule.qtactiveqt.url=git://code.qt.io/qt/qtactiveqt.git
    submodule.qtandroidextras.url=git://code.qt.io/qt/qtandroidextras.git
    submodule.qtbase.url=git://code.qt.io/qt/qtbase.git
    submodule.qtcanvas3d.url=git://code.qt.io/qt/qtcanvas3d.git
    submodule.qtcharts.url=git://code.qt.io/qt/qtcharts.git
    submodule.qtconnectivity.url=git://code.qt.io/qt/qtconnectivity.git
    submodule.qtdatavis3d.url=git://code.qt.io/qt/qtdatavis3d.git
    submodule.qtdeclarative.url=git://code.qt.io/qt/qtdeclarative.git
    submodule.qtdoc.url=git://code.qt.io/qt/qtdoc.git
    submodule.qtgamepad.url=git://code.qt.io/qt/qtgamepad
    submodule.qtgraphicaleffects.url=git://code.qt.io/qt/qtgraphicaleffects.git
    submodule.qtimageformats.url=git://code.qt.io/qt/qtimageformats.git
    submodule.qtlocation.url=git://code.qt.io/qt/qtlocation.git
    submodule.qtmacextras.url=git://code.qt.io/qt/qtmacextras.git
    submodule.qtmultimedia.url=git://code.qt.io/qt/qtmultimedia.git
    submodule.qtpurchasing.url=git://code.qt.io/qt/qtpurchasing.git
    submodule.qtqa.url=git://code.qt.io/qt/qtqa.git
    submodule.qtquickcontrols.url=git://code.qt.io/qt/qtquickcontrols.git
    submodule.qtquickcontrols2.url=git://code.qt.io/qt/qtquickcontrols2.git
    submodule.qtrepotools.url=git://code.qt.io/qt/qtrepotools.git
    submodule.qtscript.url=git://code.qt.io/qt/qtscript.git
    submodule.qtscxml.url=git://code.qt.io/qt/qtscxml
    submodule.qtsensors.url=git://code.qt.io/qt/qtsensors.git
    submodule.qtserialbus.url=git://code.qt.io/qt/qtserialbus.git
    submodule.qtserialport.url=git://code.qt.io/qt/qtserialport.git
    submodule.qtsvg.url=git://code.qt.io/qt/qtsvg.git
    submodule.qttools.url=git://code.qt.io/qt/qttools.git
    submodule.qttranslations.url=git://code.qt.io/qt/qttranslations.git
    submodule.qtvirtualkeyboard.url=git://code.qt.io/qt/qtvirtualkeyboard.git
    submodule.qtwayland.url=git://code.qt.io/qt/qtwayland.git
    submodule.qtwebchannel.url=git://code.qt.io/qt/qtwebchannel.git
    submodule.qtwebsockets.url=git://code.qt.io/qt/qtwebsockets.git
    submodule.qtwebview.url=git://code.qt.io/qt/qtwebview.git
    submodule.qtwinextras.url=git://code.qt.io/qt/qtwinextras.git
    submodule.qtx11extras.url=git://code.qt.io/qt/qtx11extras.git
    submodule.qtxmlpatterns.url=git://code.qt.io/qt/qtxmlpatterns.git
    commit.template=/root/qt5/.commit-template
    remote.gerrit.url=ssh://codereview.qt-project.org/qt/qt5
    remote.gerrit.fetch=+refs/heads/:refs/remotes/gerrit/
    user.name=Pradeep Kumar
    user.email=pradeepkm186@gmail.com



  • Now i see , their is two user.name and user.email, beacuse of this is it causing the problem ?.Help is required how to make having one user.name and user.email. and config properly. Please guide further.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.