Page MenuHomec4science

Tips & Tricks
Updated 294 Days AgoPublic

Special syntax you can use in commit messages

  • Ref T123, Refs T123or Reference T123: Attach the commit/differential to a Task
  • <prefix> Txxx <suffix>, eg.: Closes T123 as Wontfix: Close a Task
    • prefixes: closed, closes, close, fix, fixes, fixed, resolve, resolves, resolved, wontfix, wontfixes, wontfixed, invalidate, invalidates, invalidated, spite, spites, spited
    • suffixes: out of spite, as spite, as invalid, as wontfix, as resolved, as fixed
  • Reverts rXabcdef: Add reverted status to the commit: rPHTEST6144b027#936403
    • prefixes: revert, reverts, reverted, backout, backsout, backedout, back out, backs out, backed out, undo, undoes

More information: https://secure.phabricator.com/T5132#69200

Mirror repositories

You can mirror a remote repository into c4science or syncronize your c4science repository to an external platform. For that you have to go to the repository then

  • ActionsManage RepositoryURIsNew URI
  • Add the external repository URI
  • Choose the mode of operation, I/O type
    • Observe: the remote repository will be regularly checked for changes and they will be pulled into the c4science repo
    • Mirror: the c4science repo will be pushed to the external repo as soon as there are some changes
  • After creating the URI, if the repository needs credential (for the Mirror mode for instance) you can click on Set Credentialon the right of the URI configuration and setup a key or username/password pair

More information: https://secure.phabricator.com/book/phabricator/article/diffusion_uris/

NOTE: In OBSERVE mode, you first have to edit the default URI to be read-only before adding a new URI.

Webhooks and Herald

TBD

Completly remove files from the GIT history (password, binary files)

As you may know, GIT is not suited to store binary files, it's made to handle source code in plain text. If you commited files by mistake, not everything is lost. We will use a great tool called BFG !

WARNING: This is a destructive process, please read the documentation carrefuly
$ find -type f -exec ls -lh {} \; | awk '{print $5,$9}' | sort -h
  • Remove specific files, including the latest version in the HEAD commit
$ java -jar bfg.jar --no-blob-protection -D my-big-file.bin /path/to/repo
  • You can also automatically remove files bigger than a certain value,
$ java -jar bfg.jar --strip-blobs-bigger-than 10M /path/to/repo
  • Or remove a particular string in a file and replace it with something else (if you commited a password or key)
$ echo mypassword > /tmp/password.txt
$ java -jar bfg.jar --replace-text /tmp/password.txt /path/to/repo
  • After you have done removal, you have to re-compress the git history so we actually regain the space (WARNING: this is the actually the destructive process, any commit that is not attached to the history will be deleted !)
$ git reflog expire --expire=now --all && git gc --prune=now --aggressive
Last Author
aubort
Last Edited
Jan 24 2019, 17:11

Event Timeline

aubort created this document.Oct 31 2018, 14:32
aubort edited the content of this document. (Show Details)
aubort edited the content of this document. (Show Details)Oct 31 2018, 14:42
aubort added a project: c4science.
aubort edited the content of this document. (Show Details)
aubort edited the content of this document. (Show Details)Oct 31 2018, 16:47
aubort edited the content of this document. (Show Details)Oct 31 2018, 17:11
aubort edited the content of this document. (Show Details)Nov 2 2018, 08:58
aubort edited the content of this document. (Show Details)Dec 8 2018, 21:26
aubort edited the content of this document. (Show Details)Jan 24 2019, 16:01
aubort edited the content of this document. (Show Details)Jan 24 2019, 16:06
aubort edited the content of this document. (Show Details)
aubort published a new version of this document.
aubort edited the content of this document. (Show Details)Jan 24 2019, 16:47
aubort edited the content of this document. (Show Details)Jan 24 2019, 17:10
aubort edited the content of this document. (Show Details)