commit

How do I enforce the 50 character commit summary line in Sublime?

不打扰是莪最后的温柔 提交于 2019-12-05 14:02:06
As a naturally talkative soul, my summary lines almost always exceed 50 characters. How do I enforce a 50 character limit on my title lines in sublime for commit messages and commit messages only? Is there a way to customize the settings? VonC A plugin like sublime-text-git would impose a soft wrap on git commit message : { "rulers": [70] } But that applies to all the lines, not just the first one. You could modify that plugin to change colors when you type (but that would require some python programming); this is what an editor like vim does : Remember that for previous lengthy message, you

Git new file appears in all branches

半世苍凉 提交于 2019-12-05 13:23:06
I thought a file created on one branch will not appear in any other branches until I merge or rebase the branch? Example: I have two branches: master new_contact_page I checkout the new_contact_page branch. $ git checkout new_contact_page Then I create a new file. $ vi contact_page.html Without doing any Git commands, I switch back to my Master branch. $ git checkout master Then I see that this contact_page.html file is also in my Master branch. $ ls (contact_page.html shows up in the list!) Shouldn't the file only exist in new_contact_page branch? Git will never touch any files that aren't

Stages a staged file in git?

断了今生、忘了曾经 提交于 2019-12-05 13:12:50
I'm using git to manage my project. And I'm confused with the workflow of git when staging a file. If I staged files and forgot commit and then I modify that files and stages again and commit, how can I roll back to first staged ? VonC As described in " Git Internals - Git Objects ", each time you change the content of a file, and add it to the cache, you do a: git hash-object -w test.txt That stores it to the object stored. I just did two git add consecutively for one file, followed by a: C:\Users\VonC\prog\go\src\github.com\VonC\asciidocgo\.git>gfind -mmin -10 -print . ./index ./objects/4f .

Why after_commit not running even with use_transactional_fixtures = false

喜夏-厌秋 提交于 2019-12-05 12:05:57
问题 Transactional fixtures in rspec prevent after_commit from being called, but even when I disable them with RSpec.configure do |config| config.use_transactional_fixtures = false end The after_commit callback does not run. Here is a rails app with the latest rspec / rails that I have produced the issue on: git://github.com/sheabarton/after_commit_demo.git 回答1: One way around this is to trigger the commit callbacks manually. Example: describe SomeModel do subject { ... } context 'after_commit' do

Execute postgreSQL stored procedure as one transaction

给你一囗甜甜゛ 提交于 2019-12-05 11:58:19
I'm using PostgreSQL 9.3 and I have some stored procedures created which contains several statements. I'm calling this stored procedures in a Java application with the help of a prepared statement. Now I've read that each statement inside the stored procedure is executed as a transaction, i.e. one commit after each statement. But what I want is to have the whole stored procedure executed as one transaction, i.e. only one commit. How can I do this? Perhaps deactivating autocommit on the JDBC level? Well, basically stored procedures are atomic in nature and executed as one transaction. CREATE

Restricting Subversion commits if the Jira Issue key is Not in the commit message

强颜欢笑 提交于 2019-12-05 10:08:34
I am using SVN-1.7.4 for revision control and atlassian JIRA as the issue tracker for my LAMP website. I want to restrict SVN commit if any of my team member commits without mentioning the Jira Issue key for the same. I am using JIRA standalone and have installed it on my server. Google search gave me Subversion Jira Plugin (https://studio.plugins.atlassian.com/wiki/display/SVN/Subversion+JIRA+plugin) but it can only help me out in tracking the commits that had a JIRA key, not in restricting them. Please let me know, if I should post any more specifics about the issue. user1735629 It's not

Subversion: stage files to commit explicitly?

痴心易碎 提交于 2019-12-05 08:56:17
I got very used to git's way of having to touch every file you want to commit, and, while at it, double-check the diff. Now at work i have to use svn and i keep commiting stuff accidentially. Is there a way to make subversion behave like git in that i have to tell every file explicitly that should be included in the next commit? An alternative method would be to use the git-svn bridge at work, unless there are reasons as to why you can't. No one but you will have to know that you're actually using Git. This way you get all the benefits of Git while actually using Subversion. Specify the files

git hook for legit commit message (#123 good message)

£可爱£侵袭症+ 提交于 2019-12-05 08:49:16
I need to make sure commit messages are some what legit else reject it. The commit message should be like "#123 fixing missing bracket" I want to make sure it begins with hash, there is an integer (no 123a), and the message is at least 10 words. Nice to have: the message would not be the exact same in a row I am using this Trac plugin for change set, it describes the commit message format in more detail http://trac-hacks.org/wiki/TracTicketChangelogPlugin Thanks, You can create a pre-receive hook that refuses commits based on any criteria you like - you just have to print an error to standard

How to get SHA of file for specific Git commit?

柔情痞子 提交于 2019-12-05 08:47:50
Is there a way to get SHA of file for specific Git commit? It's possible with 2 commands: retrieving file git show COMMIT_VERSION:myfile.txt > ~/tmp/myfile.txt calculating SHA git hash-object ./tmp/myfile.txt But, maybe there's specific command in Git that does exactly that? git ls-tree COMMIT_VERSION myfile.txt appears to contain the same result in its third field. 来源: https://stackoverflow.com/questions/12017185/how-to-get-sha-of-file-for-specific-git-commit

Is it necessary to rollback if commit fails?

不打扰是莪最后的温柔 提交于 2019-12-05 07:18:28
This seems like a simple enough question, yet I couldn't find any definitive answers specific for MySQL. Look at this: $mysqli->autocommit(false); //Start the transaction $success = true; /* do a bunch of inserts here, which will be rolled back and set $success to false if they fail */ if ($success) { if ($mysqli->commit()) { /* display success message, possibly redirect to another page */ } else { /* display error message */ $mysqli->rollback(); //<----------- Do I need this? } } $mysqli->autocommit(true); //Turns autocommit back on (will be turned off again if needed) //Keep running