Home Blog Page 1134

Tips for Pro Git Users From 8 Open Source Project Leaders

git-logoIn honor of the 10-year anniversary of the Git revision control system this month, we talked to project leaders from eight open source projects as well as the tool’s creator, Linus Torvalds. These hard-core Git users told us how and why they use the tool for open source software development, along with their favorite tips for using it like a pro. Below are their answers, combined into a handy list of hacks. Keep in mind that these tips aren’t necessarily the only way to accomplish a given task, as Torvalds points out in his recent interview for the 10th anniversary. But they’re the features and methods that project leaders have found most useful through the years.

“You can do a lot of things with git, and many of the rules of what you *should* do are not so much technical limitations but are about what works well when working together with other people,” Torvalds said. “So git is a very powerful set of tools, and that can not only be overwhelming at first, it also means that you can often do the same (or similar) things different ways, and they all “work.” 

1. Use Aliases

Paolo Bonzini, a principal software engineer at Red Hat, QEMU contributor and maintainer of KVM:

I have several “aliases” that simplify some git tasks. Here are the simplest of them:

changes = diff –name-status -r

diffstat = diff –stat -r

whatis = show -s –pretty=’tformat:%h (%s, %ad)’ –date=short

pwhatis = show -s –pretty=’tformat:%h, %s, %ad’ –date=short

The two “-r” haven’t been necessary for several years, but those two aliases are 8 years old and I’ve never bothered to update them! The “changes” name comes from Arch, a distributed version control system from which I switched to git.

“whatis” and “pwhatis” convert a commit id to a format that can be pasted in an email. “pwhatis” is for pasting inside parentheses, “whatis” works outside parentheses. When discussing a patch it helps a lot to refer to past commits, and it’s good to use a consistent format (id, subject, date).

2. –patch

Thiago Macieira, Qt Project core maintainer and software architect at Intel

The –patch options to git add, git checkout and git reset.

3. Magit for Emacs users

Alexandre Julliard, Wine Maintainer

It’s not for everybody, but for Emacs users, I strongly recommend Magit.

I wrote the original git.el Emacs front-end, and used that for a few years, but it was never very good. I’m glad that people smarter than me have now tackled the problem, and Magit does a great job of making the full power of git accessible from Emacs.

4. Git describe

Michael Stahnke, director of engineering services at Puppet Labs:

Version your projects using `git describe`. If you use tags, you can use ‘git describe’ to version things when doing scratch builds. We do this on nearly all of our projects in our build pipelines. It takes the guess work out of the build process and unlike just using a raw sha, it sorts properly.

5. Squash commits

Nick Mathewson, Tor Director and Chief Architect:

I’ve attached a script I use to squash git commits without rebasing them. This makes the squash commits happen, but prevents (most) rebase conflicts.

6. Use autocorrect

Angie Byron, Drupal core committer and director of community development at Acquia:

I am absolutely not a pro-Git user, so my favorite pro tip is:

git config –global help.autocorrect 3

…because I am a total butterfingers and always mis-typing commands, like ‘git pusj’. This trick makes Git just do what you meant, not what you said. 🙂

7. Reorder and combine commits

Sage Weil, Ceph Creator and principal architect at Red Hat:

The combination git gui’s ability to quickly stage and unstage lines or hunks into a commit and git rebase -i’s ability to reorder and combine commits is invaluable. This allows you to work with the history as a series of patches and rearrange the content of those patches into a clean history for submission upstream.

8. Cherry pick changes

Matthew Miller, Fedora Project Leader:

Use ‘git cherry-pick’ to pull individual changes from a different branch. When I first switched to git, I would create diffs and apply them each by hand; then, when I discovered that there’s a much better way built-in, *mind blown*. In fact, I’d go so far as to generalize this: anytime you want to do something in git and it feels like the way you’re doing it is a bit awkward and clunky, take some time to look for a built-in feature which handles it better.

Read more Git anniversary stories:

How to Run Your Own Git Server

7 Pro Tips For Using Git from Fedora Developers

Git Success Stories and Tips from Wine Maintainer Alexandre Julliard

Git Success Stories and Tips from Ceph Creator Sage Weil

Git Success Stories and Tips from Puppet Labs’ Michael Stahnke

Git Success Stories and Tips from Tor Chief Architect Nick Mathewson

Git Success Stories and Tips from Drupal Core Committer Angie Byron

Git Success Stories and Tips from Qt Maintainer Thiago Macieira

Git Success Stories and Tips from KVM Maintainer Paolo Bonzini

10 Years of Git: An Interview with Git Creator Linus Torvalds

Checking Last Logins with lastlog Command

How would you like an easy way to determine the last login date for everyone on your system and prepare a list of those accounts that have never logged in at all? If you don’t know the lastlog command, you might be delighted with how easily it can provide this kind of information.

When you think about it, one of the many useful security checks that you can perform on your Linux systems is to determine the last login dates for each of your users. This kind of check can help you to detect potential problems. Accounts that haven’t been used in a very long time, for example, might indicate that those accounts are no longer needed and should be locked; maybe those individuals have changed their job assignments and you weren’t notified. Accounts that are logged into in the middle of the night or when their legitimate users are on a cruise to the Bahamas might indicate another sort of problem altogether.

Read more at ITWorld.

Linux Freedom vs. Convenience

There are various different reasons for using the Linux desktop, and at times they can conflict with each other.

Read more at Datamation

Google Faces Enormous Forces In Fight Over the Future of Android

GOOGLE AND ITS Android mobile phone operating system are facing an antitrust investigation in Europe. But the roots of the probe stretch across the Atlantic and well into the past.

In 2010, enterprise software giant Oracle sued Googleover the way Android made use of the Java programming language. Oracle had assumed control of Java a year earlier, after purchasing one-time tech powerhouse Sun Microsystems, and its suit claimed that Google had infringed on Java-related patents and copyrights. But the case turned up documents that would help spark a very different investigation in the Europe.

Read more at Wired.

Imagination to Release Open MIPS Design to Academia

Imagination is releasing a free version of its Linux-ready MIPS MicroAptiv CPU to universities called “MIPSfpga,” which will offer fully transparent RTL. Imagination Technologies has developed a Linux-ready academic version of its 32-bit MIPS architecture MicroAptiv processor design, and is giving it away free to universities for use in computer research and education. As the […]

Read more at LinuxGizmos

Tizen DevLab coming to Bangalore and Mumbai in India for May 2015

Following on from the successful Tizen DevLabs in London and Paris, we have some great news for developers as the Tizen DevLab Series is coming to India, well specifically to Bangalore and Mumbai. If your a you’re a novice or an expert, a programmer or an innovator then you are welcome to come along, you could even find yourself winning a Samsung Z1. If your Interested in: Creating a mobile app Porting over your existing mobile app to Tizen Exploring the opportunities of a new app ecosystem.   

Read more at Tizen Experts

jAlbum Photo Editing Suite for Linux Gets Updated

jAlbum, a tool that can be used to create online photo albums and that has built-in support for organizing and editing images, has been upgraded to version 12.6.4 and is now ready for download.

jAlbum is actually a suite of tools that can be used for quite a few tasks, like image editing, library management, and many more. This is a small maintenance update that fixes just a few issues and other small problems.

According to the read more)

Read more at Softpedia News

Bazel, Google’s Open Source Build System

One of the most important, yet unsung, applications in a software developer’s life is the Make utility, or its equivalent. Make first appeared in 1977 and has been with us ever since. There are a very large number of build utilities, some based on Make, others completely different. The principle remains the same. The build system has a set of rules that tell it how to build an application from source files, usually fetched from a version control system. The Make utility reads the rules, then runs the compilers and linkers to do the build. The really good ones will run tests, as well.

Google has been using their own system, called Blaze, and open-sourced part of it as the anagrammatically named Bazel — recently released at alpha status. In this article I’ll give a general overview of Bazel.

So what’s different about Bazel? It aims to do two things: build quickly and correctly. It uses a massive shared code repository where all software is built from source. Speed is achieved using both caching and parallelism. Blaze solves a slightly different problem from Bazel as it is designed for Google’s internal systems. Any Google engineer can build any Google product from source on any machine by invoking a Blaze command. 

Read more at The New Stack

Containers are a Developer’s Dreamscape

Virtual containers are secure, operating system-level user spaces that consume no more overhead than a standard application does. They are the ultimate developer’s playground–the stuff of dreams.

Read more at ZDNet News

BackBox Linux 4.2 Is a Complete Penetration Testing Distro Based on Ubuntu 14.04.2 LTS

BackBox Linux, a distribution based on Ubuntu 14.04.2 LTS, developed perform penetration tests and security assessments has just received a new update and is now ready for download.

The latest branch of BackBox Linux, 4.x, was made available back in October, shortly after Ubuntu 14.04 LTS was released. Since then, the BackBox Linux devs have upgraded their system on the newer Ubuntu 14.04.1 version and now they’ve done it once more. As you would expect, it’s more to this up… (read more)

Read more at Softpedia News