0

I have a angular project with the following package.json. I am using commitizen and git-cz along with husky for git commits. But can't get the emoji's to work in my repository.

{
  "name": "test",
  "version": "0.0.0",
  "scripts": {
    "commit": "cz",
    "prettier-check": "prettier -c .",
    "prettier-format": "prettier -w .",
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --configuration production",
    "watch": "ng build --watch --configuration development",
    "test": "ng test",
    "lh": "lhci autorun",
    "prepare": "husky install",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "cypress:open": "cypress open",
    "cypress:run": "cypress run",
    "extract-translations": "ngx-translate-extract --input ./src --output ./src/assets/i18n/*.json --sort --format json"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~12.1.0",
    "@angular/common": "~12.1.0",
    "@angular/compiler": "~12.1.0",
    "@angular/core": "~12.1.0",
    "@angular/forms": "~12.1.0",
    "@angular/platform-browser": "~12.1.0",
    "@angular/platform-browser-dynamic": "~12.1.0",
    "@angular/router": "~12.1.0",
    "@ngx-translate/core": "^13.0.0",
    "@ngx-translate/http-loader": "^6.0.0",
    "messageformat": "^2.3.0",
    "ng-zorro-antd": "^12.0.1",
    "ngx-translate-messageformat-compiler": "^4.10.0",
    "rxjs": "~6.6.0",
    "tslib": "^2.2.0",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-builders/jest": "^12.1.0",
    "@angular-devkit/build-angular": "~12.1.0",
    "@angular-eslint/builder": "12.2.0",
    "@semantic-release/changelog": "^5.0.1",
    "@semantic-release/exec": "^5.0.0",
    "@angular-eslint/eslint-plugin": "12.2.0",
    "@angular-eslint/eslint-plugin-template": "12.2.0",
    "@angular-eslint/schematics": "12.2.0",
    "@angular-eslint/template-parser": "12.2.0",
    "@angular/cli": "~12.1.0",
    "@angular/compiler-cli": "~12.1.0",
    "@cypress/schematic": "^1.4.2",
    "@lhci/cli": "^0.8.0",
    "@types/jasmine": "~3.6.0",
    "@types/jest": "^26.0.23",
    "@types/node": "^12.11.1",
    "@typescript-eslint/eslint-plugin": "4.23.0",
    "@typescript-eslint/parser": "4.23.0",
    "commitizen": "^4.2.4",
    "cypress": "7.7.0",
    "cz-conventional-changelog": "^3.2.0",
    "eslint": "^7.26.0",
    "git-cz": "^4.7.6",
    "husky": "^6.0.0",
    "jasmine-core": "~3.7.0",
    "jest": "^27.0.6",
    "ng-mocks": "^12.4.0",
    "prettier": "^2.3.2",
    "typescript": "~4.3.2"
  },
  "release": {
    "branches": [
      "master",
      {
        "name": "development",
        "prerelease": "rc"
      }
    ],
    "plugins": [
      "@semantic-release/commit-analyzer",
      "@semantic-release/release-notes-generator",
      "@semantic-release/changelog",
      [
        "@semantic-release/exec",
        {
          "verifyReleaseCmd": "echo ${nextRelease.gitTag} > .VERSION"
        }
      ]
    ]
  },
  "config": {
    "commitizen": {
      "path": "./node_modules/cz-conventional-changelog"
    }
  }
}

I am working with node version 14.17.4. Still the emojis are missing in my commit messages.

enter image description here

I would love to have the commit message like shown in git-cz demo page:

enter image description here

Any help will be appreciated

victorjpe
  • 129
  • 1
  • 9
  • This isn't exactly a *Git* issue: emoji are just funny foreign byte-sequences like the ö in schön, and Git simply copies them through to whatever is going to display them. It's up to the software that *displays* them to choose to display them *as* emoji. So the core question here is: what software are you using that displays the commit messages? – torek Aug 11 '21 at 19:10
  • I had used gitemoji's before integrating commitizen, that was displaying the emoji's in my git logs and bitbucket. However after commitizen they are missing – victorjpe Aug 11 '21 at 19:13
  • Oh: so the issue here includes more background, that everything was working *until* you added commitizen itself. That implies that commitizen introduced the problem. Probably *it* is mangling the multibyte sequences that implement Unicode. – torek Aug 11 '21 at 19:19
  • A Google search with `commitizen unicode` turns up a bunch of add-ons that people use to fix this. – torek Aug 11 '21 at 19:22
  • I think it more clear with example: https://github.com/victorjpe/misty-forest. Here i have used git-cz for commit and haven't set disableEmoji, but still the emojis are not shown. But commits i have made using normal git command displays emojis – victorjpe Aug 12 '21 at 17:13

0 Answers0