Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion git-branch-status-subtree/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,9 @@ EXAMPLES:
| 1999-12-31 tracked | (even) | (even) | 2000-01-01 origin/tracked |
```

_NOTE: please direct comments, bug reports, feature requests, or PRs to the upstream repo:
[https://github.com/bill-auger/git-branch-status/issues/][issues]_

[scrot]: http://bill-auger.github.io/git-branch-status-scrot.png "git-branch-status screenshot"

[scrot]: http://bill-auger.github.io/git-branch-status-scrot.png "git-branch-status screenshot"
[issues]: https://github.com/bill-auger/git-branch-status/issues/
12 changes: 6 additions & 6 deletions git-branch-status-subtree/git-branch-status
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# git-branch-status is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License version 3
# along with git-branch-status. If not, see <http://www.gnu.org/licenses/>.
Expand Down Expand Up @@ -231,22 +231,22 @@ function GenerateReport # (a_local_branch_name a_remote_branch_name)
does_local_exist=$(DoesBranchExist $local_branch)

# filter branches per CLI arg
[ $branch ] && [ "$branch" != "$local" ] && continue
[ $branch ] && [ "$branch" != "$local" ] && return

# filter heads
[ "$local" == "HEAD" ] && continue
[ "$local" == "HEAD" ] && return

# parse local<->remote sync status
if (($does_local_exist)) && [ $remote ] ; then
status=$(GetStatus) ; (($?)) && continue ;
status=$(GetStatus) ; (($?)) && return ;

n_behind=$(echo $status | tr " " "\n" | grep -c '^>')
n_ahead=$( echo $status | tr " " "\n" | grep -c '^<')
n_differences=$(($n_behind + $n_ahead))
n_total_differences=$(($n_total_differences + $n_differences))

# filter branches by status
(($SHOW_ALL_UPSTREAM)) || (($n_differences)) || continue
(($SHOW_ALL_UPSTREAM)) || (($n_differences)) || return

# set data for branches with upstream
local_color=$CDEFAULT
Expand All @@ -271,7 +271,7 @@ function GenerateReport # (a_local_branch_name a_remote_branch_name)
behind_color="$CDEFAULT" ; behind_msg="n/a" ;
ahead_color="$CDEFAULT" ; ahead_msg="n/a" ;
remote_color=$CDEFAULT
else continue
else return
fi

# populate lists
Expand Down