question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Some fixes to 'annotatedTag' and 'commit'

See original GitHub issue

https://github.com/isomorphic-git/isomorphic-git/pull/621#issuecomment-446284927

I just noticed this in the code:

tagger.timestamp !== undefined && tagger.timestamp !== null

That’s functionally equivalent to:

tagger.timestamp != null

There’s no reason to check for exactly null and undefined.

https://github.com/isomorphic-git/isomorphic-git/pull/621#issuecomment-446286045

I also noticed that if the tagger object passed in is missing name or email, the object is modified directly. I don’t think a function should have side effects.

And one more thing. I think the message should default to the tag name (i.e., ref) instead of being blank. That’s a pretty typical git practice.

Thanks @mojavelinux! And sorry I didn’t notice these viewpoints.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mojavelinuxcommented, Dec 13, 2018

The reason I know this is because I went on exactly the same journey not that long ago.

1reaction
wmhiltoncommented, Dec 12, 2018

@mojavelinux

There’s no reason to check for exactly null and undefined.

Hahaha yes there IS a reason! I’ll see if you can think of the edge case. 😉 @yuhr you’ll have to put these checks back.

the object is modified directly

Hmm. Yeah we can change that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Git - Tagging - Git SCM
Annotated Tags ​​ The -m specifies a tagging message, which is stored with the tag. If you don't specify a message for an...
Read more >
Fix git tagging? - Stack Overflow
If the name already points to a commit, it does nothing. If the name somehow points to a tree or blob, it produces...
Read more >
Git Tagging Explained - Initial Commit
There are two different types of git tags - lightweight and annotated. Lightweight tags are a simple reference to a specific commit.
Read more >
fix(bug): Using annotated tags now returns the correct commit ...
A customer was experiencing an issue when trying to specify commits using an annotated tag. The find_matching_rev function was returning the SHA of...
Read more >
Git Create Tag Guide {Annotated and Lightweight}
Git create tag guide (lightweight and annotated) explains how can you create and view tags in a Git project.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found