Создание файла на Python по pre-commit и commit

Хочу сделать что бы по каждому комиту автоматически форматировался файл с номером версии. Сделал так

Patch="Patch="$  PWD PreCommit=$  PWD/"Build/pre-commit.py $  PWD" python $  PreCommit exit 0 

Но возникла проблема в том что сам файл с версии тоже надо держать в репозитории, что бы на другом рабочем месте версия ПО инкрементировалась

Файл с версиям создается комититься, но после комита модификация все равно остается, почему ? пробовал после python $ PreCommit поставить задержку все равно так же.

[ Politics ] Open Question : Why is Trump so pro Brexit why does he care if the UK commit sucide by leaving the EU or staying being prosperous?

The UK should be joinning the Eurozone not leaving the EU. Trump should stop caring about irrelevant countries and worry about the USA this is coming from a Trump supporter. Anonymous he advised British government that the clown Nigel Farage should get involved in the Brexit negotiation and Boris Johnson another clown should be Prime Minister.

Git workflow (Reverting a merged branch VS a pushed commit)

I am new to using a git repository and was looking for some input.

I think I generally understand the benefit of using branches in a development workflow. My question is when it comes to reverting small changes, are branches easier or safer to revert in some way than regular commits? For example, if you apply a patch which adds one line of code, is it better to do that in a branch and merge it, or is a pushed commit sufficient?

Thanks for your help!

In two phase commit, what happens in the second phase if the coordinator fails to receive message commit was successful?

I have a somewhat obscure question about two-phase commit that came up in an interview. During the second phase, when the coordinator sends a signal to each server with commit instuctions, what if there’s a network breakdown when one of the participating systems sends the coordinator a message that it successfully implemented its commit? So basically the coordinator doesn’t know if the commit succeeded in that particular system. What happens?

Pushing commit (even in a dirty state) daily to remote git repository without polluting it with many work in progress commits


Context

We have a team of one active developer and two occasional ones. We are setting up a new project and after reading https://nvie.com/posts/a-successful-git-branching-model I was seduced by the idea of keeping only master and develop branches in the remote git repository and all feature-* branches locally to keep a clean remote.

The manager wants developers to push commits in the remote daily to not lose code even if the state of the code is dirty or in work in progress. It looks incompatible with the previous link flow.

Problem

Pushing commits daily in the remote will certainly pollute it with meaningless commits. After some days, we will have several commits with more or less the same title which will just be some sort of backup of the code.

I thought about a way to amend remote commits to keep only one remote work in progress commit but it does not look possible or not advised. I also thought about pushing with force option the branch so I can amend locally and push my branch to the remote. I am not sure if it is something advised.

Question

Is there a proper way to push the code to the remote daily without creating several commits and potentially pollute the remote repository?

OpenShift “Build failed because of post commit hook.” on Build

I have been trying to build and deploy a MEAN stack application using OpenShift. I have applied the template Node.js and MongoDB when I created my project. I cannot seem to find any resources to help me and have attempted to understand this documentation also trying the method of configuring a post commit hook to an existing project. The OC shell stated that I successfully “Updated” the post commit hook. But I am still getting this error. Plus, it takes 49 minutes to build, only to fail after dependencies are installed.

Cloning "CONFIDENTIAL" ...     Commit: CONFIDENTIAL     Author: CONFIDENTIAL>     Date:   CONFIDENTIAL ---> Installing application source ... ---> Installing all dependencies npm WARN notice [SECURITY] base64url has the following vulnerability: 1 moderate. Go here for more details: https://nodesecurity.io/advisories?search=base64url&version=2.0.0  - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info. npm WARN notice [SECURITY] hoek has the following vulnerability: 1 moderate. Go here for more details: https://nodesecurity.io/advisories?search=hoek&version=2.16.3  - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info. npm WARN notice [SECURITY] lodash has the following vulnerability: 1 moderate. Go here for more details: https://nodesecurity.io/advisories?search=lodash&version=4.17.5  - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info. npm WARN notice [SECURITY] mpath has the following vulnerability: 1 moderate. Go here for more details: https://nodesecurity.io/advisories?search=mpath&version=0.3.0  - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info. npm WARN meanauthapp@1.0.0 No repository field.  added 106 packages in 2928.818s ---> Building in production mode ---> Pruning the development dependencies npm WARN meanauthapp@1.0.0 No repository field.  up to date in 0.679s /opt/app-root/src/.npm is not a mountpoint ---> Cleaning the npm cache /opt/app-root/src/.npm /tmp is not a mountpoint ---> Cleaning the /tmp/npm-* Running post commit hook ... sh: cannot set terminal process group (-1): Inappropriate ioctl for device sh: no job control in this shell  > meanauthapp@1.0.0 test /opt/app-root/src > echo "Error: no test specified" && exit 1  Error: no test specified npm ERR! Test failed.  See above for more details. error: build error: container "CONFIDENTIAL" returned non-zero exit code: 1 

How to enforce a format for a (pull request) merge commit message in BitBucket

Our team is migrating to BitBucket. Our workflow requires certain formatting for commit messages for code that is merged into the main origin repo.

Each developer has one (or more) fork(s). Our workflow is to push a feature/bug branch to the fork and create a pull request from that branch. Two other devs must review and +1 the pull request before it can be merged.

When someone clicks Merge, BitBucket displays a dialog with the title “Merge Pull Request”. At that point, the dev can edit the text message that is logged for the merge before clicking the second Merge button. This is the message that needs to conform to a specific format.

I have read the documentation here: https://scriptrunner.adaptavist.com/latest/bitbucket/StashMergeChecks.html It has several very specific examples, but nothing that pertains to our use case. I have not been able to find a good, general-purpose reference for how to create merge checks.

How can I write a pre-merge hook to reject the merge if the message doesn’t conform to a regex?

sublime text (3200) not allowing git commit ,how to resolve sublime text git commit issue?

I am using Ubuntu 18.04 ,I have removed previous version of sublime text through Ubuntu Software and then installed it through sublime text’s official documentation given Here .

After that Whenever I am trying to git commit it gives the following message and does nothing .

git commit hint: Waiting for your editor to close the file...  '/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl'  -n -w: 1: '/Applications/Sublime Text  2.app/Contents/SharedSupport/bin/subl' -n -w:  /Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl:  not found error: There was a problem with the editor ''/Applications/Sublime  Text 2.app/Contents/SharedSupport/bin/subl' -n -w'. Please supply the message using either -m or -F option. 

As I am still new to Linux/Ubuntu so want to understand what exactly this issue is and how to resolve it .my current installed version of sublime text is build 3200 . Kindly suggest a way to resolve this issue ,thank you !

Using nano in Cygwin’s Mintty: Shortcuts don’t work when editing git commit message

I’m using Cygwin with Mintty and have set the git editor to nano: git config --global core.editor "nano".

Now when I just run nano, the UI is black and white and the shortcuts, like ctrl+o and ctrl-x work just as expected. But when I create a git commit, nano’s UI is colored, the shortcuts don’t work any more and when I press the arrow keys, the letters A,B,C and D are entered. On Linux, I’ve never seen nano behave differently when run through git.

What causes this and how can I disable this?

How to detect to which branch a tagged commit was merged into

As part of a ci process I have, which is triggered by git tags, I need to auto-update something in the code, using that tag name, and then commit the result back to git.

Problem is, after a successful merge request, the branch is usually deleted, so the tag for that commit, is now completely detached and is not contained within any branch, so “commiting back to git” is not so trivial, because I don’t have a branch to commit into.

I can commit by default into master, and that will usually work, but there will be edge cases in which I cannot predict the behavior for.

A more reasonable solution, is to somehow (if possible) figure out to which branch a tagged commit was merged into, so that I’ll commit back to that branch.

Is that possible?

(also, if you see any problems with this approach and/or have something better to suggest, please share your thoughts)