When you have a set of lines that contain comments without spaces like the following example that contains a # and just a new line
# Derive default tags from git; user can append extras via EXTRA_TAGS="tag1 tag2"
# GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD | tr '/' '-')
# GIT_HASH := $(shell git rev-parse --short HEAD)
# DEFAULT_TAGS := $(GIT_BRANCH) $(GIT_HASH) latest
# ALL_TAGS := $(DEFAULT_TAGS) $(EXTRA_TAGS)
#
# LOCAL_IMAGE := image-name
and you visually select each of these lines and hit gc you end up with
# # Derive default tags from git; user can append extras via EXTRA_TAGS="tag1 tag2"
# # GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD | tr '/' '-')
# # GIT_HASH := $(shell git rev-parse --short HEAD)
# # DEFAULT_TAGS := $(GIT_BRANCH) $(GIT_HASH) latest
# # ALL_TAGS := $(DEFAULT_TAGS) $(EXTRA_TAGS)
# #
# # LOCAL_IMAGE := image-name
instead of
# Derive default tags from git; user can append extras via EXTRA_TAGS="tag1 tag2"
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD | tr '/' '-')
GIT_HASH := $(shell git rev-parse --short HEAD)
DEFAULT_TAGS := $(GIT_BRANCH) $(GIT_HASH) latest
ALL_TAGS := $(DEFAULT_TAGS) $(EXTRA_TAGS)
LOCAL_IMAGE := image-name
When you have a set of lines that contain comments without spaces like the following example that contains a # and just a new line
and you visually select each of these lines and hit gc you end up with
instead of