I am using Gerrit for code review for all the SQL files that is being used in the Project. Gerrit is hosted on Linux machine and its version is 2.6.1.
I have problem in comparing SQL patch set and all the SQL files are considered to a binary file by Gerrit and hence unable to provide the comparison.
For reference, following is the response on Gerrit comparison:
diff --git a/web/dev-db/sp/dbo.usp_getactivityownerlist.sql b/web/dev-db/sp/dbo.usp_getactivityownerlist.sql
index f623dd3..e2ed93b 100644
--- a/web/dev-db/sp/dbo.usp_getactivityownerlist.sql
+++ b/web/dev-db/sp/dbo.usp_getactivityownerlist.sql
Binary files differ
Is there any way I can configure Gerrit to consider .SQL file as a text file rather than binary file so that patch comparison is easy.
Try adding the following line to your $repo/.git/info/attributes:
*.sql crlf diff
It normally happens when user set core.autocrlf to false in global config file. This effectively disabled "smart" detection of line endings in text files.
It can be encoding issue as well, Git works best with utf-8, if the encoding is in something like utf-16, Git will think it's binary, no matter what you set in .gitattributes
Related
When FITNESSE is started with command -e 0, then by default the .zip folders are not created.
Now how can we track the version of WIKI pages in FITNESSE
java -cp !CLASSPATH! fitnesseMain.FitNesseMain -p 9090 -e 0
I usually use 'normal' version control (e.g. Git or Subversion) on the wiki files in the project. This also has the advantage that you choose when to commit the changes you make (i.e. not each change/edit is committed, but only when one or more pages are 'done' and tried locally) and you can provide explicit messages what was changed and why in that commit.
You probably don't want to store all files in the wiki in version control, but only the test pages and suites you make and the files in the 'files section'. The .gitignore file I usually use can be found at: https://github.com/fhoeben/sample-fitnesse-project/blob/master/.gitignore. (For Subversion you can set an svn-ignore property instead of using a .gitignore file)
I expect you want to exclude at least:
fitnesse-standalone.jar
FitNesseRoot/**/*.zip
FitNesseRoot/files/testResults
FitNesseRoot/files/testProgress
FitNesseRoot/ErrorLogs
FitNesseRoot/FitNesse
FitNesseRoot/RecentChanges*
updateDoNotCopyOverList
updateList
properties
I am learning Ruby on Rails and I use Windows 7. When I try to commit my changes to Git, I receive the fatal: LF would be replaced by CRLF message.
It seems that rails generate generates files with LF, not CRLF. Of course, I may switch from
git config --global core.autocrlf true
git config --global core.safecrlf true
to
git config --global core.autocrlf true
git config --global core.safecrlf warn
but I don't like the possibility of crushing any committed binary into pieces.
I tried to avoid the problem with .gitattributes, but my lines like
* text=auto
*.rb text
do not help.
Is there a way to make Rails generate files with CRLF ending? Or is there a way to make Git auto-transform the .rb and .erb files, but not others?
I don't like the possibility of crushing any committed binary into
pieces.
Are you sure that's a real problem?
If you turn the warnings off (core.autocrlf true) git will make the adjustments when you commit and you can continue being productive.
If you truly have a solid reason for not wanting to do this you are going to have difficulty as I don't think there is a simple way (there is always some way) to have Rails generate files with the CRLF ending and it's weird to have git auto-transform based on file type.
I can certainly be wrong, but it seems like you're trying a bit too much to work against your tools?
Possibly useful reference: git commit creates assets and temporary files for some reason
If you really want to go down the road of attempting to configure git to make these changes you can check out a git attribute filter driver as suggested in this response: Can git automatically switch between spaces and tabs?
Another useful reference to the above proposed solution: https://stackoverflow.com/a/2354278/1026898
I'm converting my SVN repo into git (bitbucket) following this tutorial: https://www.atlassian.com/git/tutorials/migrating-convert/
But I keep getting this message when runing the command : git svn clone --stdlayout --authors-file=authors.txt --prefix=origin/
The answer is somewhat explained in the comment.
Similar issues are experienced on Windows system due to its
limitations like:
Some of the Windows APIs are limited to 260 symbols for file path name. So git can't create files with names longer than 260 symbols. NTFS file system actually supports longer names (32k).
Windows directory allows Space in between like my folder.
Windows file and folder names that begin or end with the ASCII Space (0x20) are saved without these characters.
Some of the Workarounds are:
Move the git directory closer to the drive, in order to keep the file name within 260 symbols.
Creating the whitespace directory manually using tools like FAR, GnuWinwhich can make a directory
Reference:
Support for Whitespace characters in File and Folder
git svn importing a branch with a trailing space
git checkout error: unable to create file
As the title says (and as it may be visible that I am still a beginner). In my rails app, I have implemented an MVC for support pages to my app.
I wanted to show the pages that I created to my mentor, so I committed and pushed to GitHub, but I noticed that only the images were pushed to GitHub! (I use CKeditor to handle images).
Now I am sure that the pages (that consists of a Title and Contents fields) exist, because when I execute the command db.support_pages.find() in the Mongo Shell, it gives me back a list of the pages with their contents and titles. But when I open those pages (localhost) and edit the content I see that git is not even tracking them!
I don't know what more information I should post, I will post the .gitignore file:
*.rbc
*.sassc
*~
.sass-cache
.project
capybara-*.html
.rspec
/.bundle
/vendor/bundle
/log/*
/tmp/*
/public/assets/*
/db/*.sqlite3
/public/system/*
/coverage/
/spec/tmp/*
/spec/coverage/*
**.orig
rerun.txt
pickle-email-*.html
# Ignore all logfiles and tempfiles.
/log/*.log
/tmp
.idea
/attic/*
Any tips, leads, advice (or even queries to post more info regarding this issue) are welcomed. :)
Thanks in advance.
Your MongoDB database is composed of multiple data files containing the data and indexes.
If you want to commit the contents of the database to version control you will want to export the data and index definitions using mongodump.
If you want to share your database with your mentor, I would suggest using mongodump to get a full copy of the database, then compress and add that dump into git.
For example (on Linux) .. assuming a database called mydatabase:
cd ~/backup
mongodump -d mydatabase
tar -czvf mydatabase.tgz dump/
git add mydatabase.tgz
Your mentor would need to have MongoDB installed, and could extract the tgz file (tar xzvf mydatabase.tgz) and use mongorestore to load the data. I expect your application might require future configuration, which you would document in a README.
Git will track changes made in its directory. The pages you're talking about are stored in the database which is located somewhere else in your computer. We will need more information to give you some advice as to where you should dig.
I have have to work on a windows machine at work but have a mac at home. All of my rails code is written on the mac which is using RVM and deploying to heroku using GIT.
However I want to start working on the code on a windows machine (code held in dropbox and synced automatically)
I remember that line endings caused hell in git when I used to write python code... What are the requirements to be able to right RoR using two different operating systems?
You can configure git to convert line endings to one or the other upon committing: http://help.github.com/line-endings/
When you are describing paths, be sure to use built in methods for constructing them OS independently, like File.join.
You need to use the core.autocrlf feature.
From the manual
core.autocrlf
Setting this variable to "true" is almost the same as setting the text attribute to "auto" on all files except that text files are
not guaranteed to be normalized: files that contain CRLF in the
repository will not be touched. Use this setting if you want to have
CRLF line endings in your working directory even though the repository
does not have normalized line endings. This variable can be set to
input, in which case no output conversion is performed.
git config --global core.autocrlf true
So, In your windows machine, set this feature to true, which means,
During commit, your line endings will automatically be changed to LF and when you checkout your local files will have Windows' line endings (i.e., CRLF)
git config --global core.autocrlf input
In your non-Windows machine, set this to input, which means
Don't do any conversions, I'm not prone to any line ending changes
Why not configure heroku on your work machine instead? You already have version control (git) to take care of syncing and sharing your app.