Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combine the two hashes only if the file names differ #1302

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
Jupytext ChangeLog
==================

1.16.6 (2024-12-16)
-------------------

**Fixed**
- We fixed a "File Changed" warning when saving notebooks ([#1301](https://github.com/mwouts/jupytext/issues/1301))

**Changed**
- The original file name is easier to infer from the tmp file name in pre-commit hooks ([#1289](https://github.com/mwouts/jupytext/issues/1289)) - thanks to [Lunin Leonid](https://github.com/lrlunin) for making this change.


1.16.5 (2024-12-15)
-------------------

Expand Down
29 changes: 16 additions & 13 deletions src/jupytext/contentsmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,19 +341,22 @@ def read_one_file(alt_path, alt_fmt):
model["last_modified"] = inputs.timestamp

if require_hash:
if inputs.path is None or outputs.path is None:
return model
model_other = self.super.get(
inputs.path if path == outputs.path else outputs.path,
require_hash=True,
)
# The hash of a paired file is the concatenation of
# the hashes of the input and output files
if path == outputs.path:
model["hash"] = model_other["hash"] + model["hash"]
else:
model["hash"] = model["hash"] + model_other["hash"]
return model
if (
inputs.path is not None
and outputs.path is not None
and inputs.path != outputs.path
):
model_other = self.super.get(
inputs.path if path == outputs.path else outputs.path,
content=False,
require_hash=True,
)
# The hash of a paired file is the concatenation of
# the hashes of the input and output files
if path == outputs.path:
model["hash"] = model_other["hash"] + model["hash"]
else:
model["hash"] = model["hash"] + model_other["hash"]

if not content:
return model
Expand Down
2 changes: 1 addition & 1 deletion src/jupytext/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Jupytext's version number"""

__version__ = "1.16.5"
__version__ = "1.16.6"
Loading