Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can arc diff exclude certain files in Phabricator?

Some C++ files are system generated and not necessary to review. In addition, these files are rather large and sometimes it causes "the request to exceeds the capacity limit". A better place to review it is to compare the new schema and old schema files. These files are part of the commit so I don't want to use .gitignore against them.

This is one other post about this I found on internet but it wasn't helpful. http://www.quora.com/Can-I-use-arc-diff-to-exclude-some-files-in-Phabricator

like image 235
dhu Avatar asked Aug 04 '15 15:08

dhu


People also ask

How does ARC land work?

arc land: Works in Git if you develop in feature branches. Does a merge or squash-merge from your feature branch into some master branch, provides a detailed commit message, pushes master, and then deletes your branch. arc amend: Works in Git if you can't use arc land. Amends HEAD with a detailed commit message.

What does ARC patch do?

It is helpful to understand that arc patch , by default, will not attempt to patch the revision on top of your current working set. Instead, it applies the changes on top of the same parent commit the author used and creates a new commit and a new branch (git) or bookmark (hg).


1 Answers

I did some searches and I found out answers myself.

It's possible that you've accidentally included something not suitable for human review, e.g. binary files or generated files.

Solution includes:

  1. If you put the string @generated anywhere in a file then Differential will not try to review it. (this may not stop arcanist from trying to upload it however)

  2. If you supply the --less-context flag to arcanist then instead of sending whole files it will only send a small amount of surrounding context.

  3. Use .gitattributes. Here's an example of using .gitattributes to exclude messages files from diffs, see the the Git Book for more information. Note that you may need to commit the new .gitattributes before it has an affect on your diffs.

    *_hugetext.h         -diff
    *_hugetext.cpp       -diff
    
  4. arc diff --skip-binaries If you mark a file as binary and supply the --skip-binaries flag then arcanist will not try to upload it. Please see the Git Book for an example of marking a file as binary.

  5. git diff origin/master... --stat If you're using Git, you can get more insight into why your diff is large by using this command to examine the diff stat. (assuming your base is origin/master)

  6. git diff origin/master... | wc --bytes If you're using Git, you can easily see the size of the diff arcanist is trying to upload with this command. (assuming your base is origin/master)

like image 145
dhu Avatar answered Oct 29 '22 04:10

dhu