When a commit to revision control requires a developer to change their own config

后端 未结 5 674
独厮守ぢ
独厮守ぢ 2020-12-10 17:30

What\'s the best method to notify other developers when a change committed into revision control requires some specific additional action by the developer getting the update

相关标签:
5条回答
  • 2020-12-10 17:32

    There should rarely be changes necessary that are outside of revision control. For the rare cases where they are, use the regular communication channel the developers have (like mailing list or IRC channel or something similar). Every multi-developer project needs such thing anyway.

    0 讨论(0)
  • 2020-12-10 17:32

    Just an idea, but you could have trigger based on a pattern in the commit message to send a mail with the commit comment to developers

    doable with hooks

    0 讨论(0)
  • 2020-12-10 17:40

    With git, what you could do (even if it isn't really there for that scenario) is to use a filter driver, provided your commit includes changes for a file with a recognizable content (the filter doesn't have a name or path of the file).

    enter image description here

    A filter driver is:

    • declared in a .gitattributes files (meaning, contrary to hooks or triggers, you can easily distribute it)
    • attached to a smudge and a clear script (also versioned, the smudge one being triggered on commit.
    • you can, on commit, triggers whatever automatic action you need.

    Again, the point is to not use hooks (which you can't easily replicated amongst repos), and use a mechanism which can be versioned and cloned around.

    0 讨论(0)
  • 2020-12-10 17:52

    For files where each developer needs to make local changes (like database connection strings, etc.) I like to keep a template as a tracked file, something like localconfig.template. In your build/launch scripts you could have logic like this:

    if not exists localconfig then
      copy localconfig.template to localconfig
    else
      if localconfig.template is newer than localconfig
        print a big ugly warning about maybe needing to update
    
    0 讨论(0)
  • 2020-12-10 17:55

    Personnally, I use 2 methods :

    1. the communication one : I tell to other developpers what manipulations are to do to be up-to-date (correct, but sometimes, we miss some details ....)
    2. the scripted one : I made an update script that is used to manage the update of all the parts of my project (different directories, different repositories, different version control...), in this script I put every operation needed to maintain a correct repository (I use it for svn and git repositories).
    0 讨论(0)
提交回复
热议问题