MATAB File revisions are out of order

1 回表示 (過去 30 日間)
Nickolai Belakovski
Nickolai Belakovski 2022 年 7 月 8 日
回答済み: arushi 2023 年 12 月 28 日
When right clicking on a file in MATLAB that's tracked by git and going to "Source Control -> Show Revisions" MATLAB appears to be sorting the commits by date, as opposed to looking at parent commits. Dates can be misleading as they can be modified by rebases or even on purpose (and there's also the difference between AuthorDate and CommitDate, MATLAB appears to be using the former even though the latter looks like it's slightly better, even if it's not as good as using the parent commit).
This causes confusion when comparing against older revisions. Is this a known bug and/or is there a fix or a workaround?

回答 (1 件)

arushi
arushi 2023 年 12 月 28 日
Hi Nickolai,
I understand that you are facing confusion when comparing against older revisions. MATLAB integrates with Git for source control, providing a basic set of features directly within the MATLAB environment. However, MATLAB's source control interface is not as comprehensive as dedicated Git clients or command-line tools.Here are a few workarounds you could consider:
  1. MATLAB Command Window: You can use Git commands directly in MATLAB's Command Window by prefixing them with an exclamation mark ! to access the system shell.
  2. Use a Dedicated Git Client: For more advanced Git operations and accurate commit history visualization, you can use a dedicated Git client (like GitKraken, SourceTree, or even the command-line interface). These tools provide a more accurate representation of the commit graph and allow for more complex operations.
  3. External Scripting: Write a script (in Bash, Python, etc.) that uses Git commands to fetch the commit history in the desired format. You can then call this script from MATLAB if needed.
Link to the documentation of using Git with MATLAB - https://www.mathworks.com/help/matlab/matlab_prog/use-git-in-matlab.html
Hope this helps.
Thank you

カテゴリ

Help Center および File ExchangeSource Control Integration についてさらに検索

タグ

製品


リリース

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by