Skip to content

[FIX] odoo-shippable: Fix slow prompt in big git workdir

Currently the script to get git status to set the color of the branch in the prompt (red or green) is very slow with bigger git directories.

I used follow gist: https://gist.github.com/sindresorhus/3898739 to fix performance. This script work very similar but faster.

Example:

Without changes: screen shot 2016-02-12 at 9 44 35 pm

With changes in versioned file: screen shot 2016-02-12 at 9 45 08 pm

With changes in unversioned file: screen shot 2016-02-12 at 9 46 01 pm Here the difference: We have a green branch with unversioned files.

When you execute a git add then now is red: screen shot 2016-02-12 at 9 49 49 pm

This is a disadvantage but IMHO the performance issue is a greater problem.

Merge request reports