Coder Social home page Coder Social logo

Feature request: exclude specific commits when calculating the 'last update' calculation about mkdocs-git-revision-date-localized-plugin HOT 3 OPEN

markszabo avatar markszabo commented on June 26, 2024
Feature request: exclude specific commits when calculating the 'last update' calculation

from mkdocs-git-revision-date-localized-plugin.

Comments (3)

timvink avatar timvink commented on June 26, 2024

That would be a nice addition. I'd prefer to this outside of the plugin if possible.

For example, for git-authors the main command it git blame, and there you have the option to specify a file with commit hashes to ignore (see timvink/mkdocs-git-authors-plugin#71) for details.

Preferably I would like a similar approach for this plugin (which uses git log, see below). A quick glance at the docs for git log show this isn't possible.

# Latest commit touching a specific file
commit_timestamp = git.log(
realpath, date="unix", format="%at", n=1, no_show_signature=True
)

Do you already have a specific approach in mind?

from mkdocs-git-revision-date-localized-plugin.

timvink avatar timvink commented on June 26, 2024

The --exclude parameter (https://git-scm.com/docs/git-log#Documentation/git-log.txt---excludeltglob-patterngt) seems promising

Going through this blogpost, it seems we could add a .git-log-exclude to the root of a project, container a list of commit hashes.

Update: from the blogpost, it also requires setting a global or local git config option (something like git config log.exclude .git-log-exclude). That's something to be aware of when collaborating with a team on documentation, or when setting up your CI/CD build.

If that works, we would only need to update the documentation with an additional 'how to' page.

from mkdocs-git-revision-date-localized-plugin.

markszabo avatar markszabo commented on June 26, 2024

Thanks for the quick reply! I played around with the options (including the one you suggested), but didn't find anything that would work. The closest I could get is to exclude certain commits by commit message, but even this requires cli parameters and doesn't seem to be configurable via the git config:

git log --oneline --invert-grep --grep='Update team name' docs/index.md

Meanwhile my colleague implemented this feature and will send a PR after testing it.

from mkdocs-git-revision-date-localized-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.