Send arguments from git push

We use the post-receive git hook to automatically minimize our JS and synchronize our local and remote developer databases.

This is usually desirable, but sometimes not.

Is there any need to pass the argument to the hook after receiving with git so that it can be turned off when necessary?

Thank!

+5
source share
4 answers

If you keep the post-receivehook , you can decide to run the script based on the link name for each file.

This hook [...] takes no arguments, but for each ref that needs to be updated, it receives a format string on standard input:

<old-value> SP <new-value> SP <ref-name> LF

Where:

  • <old-value> is the old name of the object stored in ref,
  • <new-value> - , ref
  • <ref-name> - .

, ref-name , script.

+2

Git 2.10 ( 2 2016 .) --push-option git push:

-o
--push-option

, , . NUL LF.

+6

- , receive-deploy , .

+1

git (,) .

:

  • ( ).

    - ( ). (, / ) , / ( , , ).

    , , , "" , ( , ).

    - , , , , , , .

    , , " " . , , , , "no minify".

  • .

    , brach-nominify branch, . , (, , branch-nominify branch).

  • , .

    git , . .

+1

Source: https://habr.com/ru/post/1753783/


All Articles