Skip to content

Comments Followed Immediately By New Lines Break gc Command #180

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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