Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makepkg: add description #5299

Merged
merged 1 commit into from
Aug 10, 2022
Merged

makepkg: add description #5299

merged 1 commit into from
Aug 10, 2022

Conversation

pirate486743186
Copy link
Contributor

missing description

@rusty-snake rusty-snake changed the title [minor makepkg] add descripton makepkg: add descripton Aug 7, 2022
Copy link
Collaborator

@kmk3 kmk3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Regarding the commit message:

[makepkg] add descripton

Change it to:

makepkg: add description

Background

Git strips all occurrences of subject prefixes when applying a commit as a
patch, so it would be better to avoid using [] as a prefix in commit message
titles. From git-am(1):

DISCUSSION
       The commit author name is taken from the "From: " line of the message,
       and commit author date is taken from the "Date: " line of the message.
       The "Subject: " line is used as the title of the commit, after
       stripping common prefix "[PATCH <anything>]". The "Subject: " line is
       supposed to concisely describe what the commit is about in one line of
       text.

For example, given a commit with any of the following titles:

  • [PATCH] add description
  • [makepkg] add description
  • [PATCH makepkg] add description
  • [PATCH] [makepkg] add description

Applying it as a patch would change the title to just add description:

prefixtest

Code:

prefixtest() {
set -e

msgs='[PATCH] add description
[makepkg] add description
[PATCH makepkg] add description
[PATCH] [makepkg] add description'

git checkout -B prefixtest master 2>/dev/null
printf '%s\n' "$msgs" | while read -r msg
do
	echo 1 >>README.md
	git add -u
	git commit -m "$msg" >/dev/null
done

printf '(original)\n'
git log --pretty=%s master..

head="$(git rev-list HEAD~1..HEAD)"
git reset --hard master >/dev/null

printf '\n(git am output)\n'
git format-patch --stdout "master..$head" | git am

printf '\n(applied commits)\n'
git log --pretty=%s master..
}
prefixtest

Output:

(original)
[PATCH] [makepkg] add description
[PATCH makepkg] add description
[makepkg] add description
[PATCH] add description

(git am output)
Applying: add description
Applying: add description
Applying: add description
Applying: add description

(applied commits)
add description
add description
add description
add description

From what I've seen, usually the point of using a subject prefix is to specify
the intended project/repository when a single mailing list is used to receive
patches for multiple projects. Additionally, the prefix is usually added to
the patch file with git-format-patch(1) (which can then be sent with
git-send-email(1)), rather than being written on the commit message itself.

From git-format-patch(1):

       --subject-prefix=<subject prefix>
           Instead of the standard [PATCH] prefix in the subject line, instead
           use [<subject prefix>]. This allows for useful naming of a patch
           series, and can be combined with the --numbered option.

etc/profile-m-z/makepkg.profile Outdated Show resolved Hide resolved
@kmk3 kmk3 changed the title makepkg: add descripton makepkg: add description Aug 9, 2022
Copy link
Collaborator

@kmk3 kmk3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makepkg.profile, add description

s/,/:/

etc/profile-m-z/makepkg.profile Outdated Show resolved Hide resolved
@kmk3 kmk3 mentioned this pull request Aug 10, 2022
Copy link
Collaborator

@kmk3 kmk3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@kmk3 kmk3 merged commit 56c2f82 into netblue30:master Aug 10, 2022
@pirate486743186 pirate486743186 deleted the description-makepkg branch March 3, 2023 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants