Tag: coding style

How to display code in certain format but commit in another?

Me and a friend of mine are working on a codebase and a problem has arisen. So, I gladly adhere to any common style standard which has some tooling support for auto-format. My friend has harder to read code and strongly prefers things like functions in the following format function foo() { console.log(‘bar’); } This […]

Same variable names used in two branches (Git)

As a social scientist trying to use Git, I have an incredibly newbie question. Say I have two branches, each contains a variable foo. When I merge these two branches, the variable foo will be defined in two places, causing confusion. This is basic coding error in general, not particular to Git of course. But […]

How do I show that I'm getting the smallest number of conflicts with Git by using K&R instead of B&D as the coding standard?

Git is smart and will “follow” changes in history to make merging easier and auto merge more for me. Conflicts are delineated by the lines that have not changed around the change. With K&R you get no ambiguous lines that have only “{” in them like you would in B&D. How would I test the […]

Where to hook a coding convention script?

When working in large teams code styling tools are often used to enforce coding convention compliance. The problem is not to find such a tool. It is more the question of, when you execute this tool? When do you execute this tool (e.g. astyle)? I worked in projects, that are using the first two approaches. […]

Reject commit in Git if Java code style isn't correct

Can anyone recommend an approach to have my Git repo reject commits if the Java code being committed doesn’t conform to a predefined coding standard. I’m fed up of seeing a mix of tabs and spaces and a commit log with entries such as ‘Converting tabs to spaces’. I have Eclipse configured to automatically perform […]

Enforcing coding style with pre-receive Git hook

I am working on an embedded Linux project with a small team, and we have decided to enforce a C coding style. We have chosen the Linux Kernel coding style, and we use the script provided in the Kernel tree checkpatch.pl to check our patches. We would like to check the coding style before accepting […]

Ensure coding-style during a git commit

Im my company i set-up a continuous integration test and i run the tests when someone push the code on the server. Now i want to check that the code match with the our basic coding rules, the first rule is “run mogrify on your code!” There is something to do this check “out the […]

Which style do you use for your commit messages? Technical or feature-based?

Lets say you are working on a some type of web applications. Here are the 2 different versions of commit messages for the same change set. Redirect user to user_profile for public controllers -or- Restrict logged in user acces to public controllers Add require_guest before filter to necessary controllers The first one explains what is […]

Why maintain traditional detailed ChangeLog in modern world (with SVN, Mercurial, Git)?

Detailed ChangeLog entry usually tell who, when and what function changed and for why this change done. And this for every separate function in the source code tree! As I understand ChangeLog come from past when there were no good VCS. So traditional ChangeLog doesn’t need at all as you can get it all from: […]

Checking in of “commented out” code

Ok, here is something that has caused some friction at my current job and I really didn’t expect it to. Organized in house software development is a new concept here and I have drawn up a first draft of some coding guidelines. I have proposed that “commented out” code should never be checked into the […]

Git Baby is a git and github fan, let's start git clone.