Skip to content

Comments Followed Immediately By New Lines Break gc Command #180

@alex-iocurrents

Description

@alex-iocurrents

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions