add support for .vcpromptignore

Leho Kraav avatarLeho Kraav created an issue

i'd like to disable vcprompt in occasional large directories, such as kernel trees, since it's just takes too long to load the prompt.

my first thought is for vcprompt to check for well-known filename and just exit with "-" or some other shortish mark for "disabled in this directory".

i'm guessing this can also be achieved by having a similar shell-based mechanism for messing around with PS1. i think vcprompt way is probably cleaner, but thoughts welcome.

should be a simple patch either way.

Comments (6)

  1. Greg Ward
    • changed status to open

    Patches are welcome! I don't actually use vcprompt; I only wrote it because I was offended by various blog posts advocating outrageously expensive things in every shell prompt that only worked for a single VC system anyways. So any features are going to have to come from users like you.

    Here's my suggestion: put the "ignore me" file in the VC metadata dir, i.e. .git or .hg or .svn or whatever. If it's there, make vcprompt quickly return the empty string. I don't see any reason to have a special "no info" string -- the empty string should be fine. (If you *really* want a non-empty string, how about using the contents of vcpromptignore?)

    This means you're still going to suffer the overhead of walking up the filesystem to find .git or .hg or whatever, and an extra stat() in that dir which will usually fail.

    Also, I'm not sure how this would work with CVS. Would the user be forced to put vcpromptignore in every CVS directory in their tree? Yuck.

  2. Leho Kraav

    thanks for feedback. i myself can't really let cvs hold anything back. i've also noticed now that accidentally accessing git repos over NFS over VPN can be painful, so i guess this could be incorporated here as well.

    i'll have a looksee when i can come up with something.

  3. Leho Kraav

    in addition to the previous, i've now discovered that autofs should somehow be accounted for:

    May 21 16:55:30 travelmate automount[18733]: attempting to mount entry /mnt/CVS
    May 21 16:55:30 travelmate automount[18897]: failed to mount /mnt/CVS
    May 21 16:55:30 travelmate automount[18733]: attempting to mount entry /mnt/.git
    May 21 16:55:30 travelmate automount[18898]: failed to mount /mnt/.git
    May 21 16:55:30 travelmate automount[18733]: attempting to mount entry /mnt/.hg
    May 21 16:55:30 travelmate automount[18899]: failed to mount /mnt/.hg
    May 21 16:55:30 travelmate automount[18733]: attempting to mount entry /mnt/.svn
    May 21 16:55:30 travelmate automount[18900]: failed to mount /mnt/.svn
    May 21 16:55:30 travelmate automount[18733]: attempting to mount entry /mnt/_FOSSIL_
    May 21 16:55:30 travelmate automount[18901]: failed to mount /mnt/_FOSSIL_
    
  4. Greg Ward

    Until this is implemented, you might be interested in the timeout feature that was added ... ummm .. a while ago. Just add "-t 100" to your vcprompt command line, and it will abort after 100 ms. Pick whatever value of 100 you are comfortable with.

  5. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.