<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>emre şahin's digital garden 🍃 - xvc-file</title>
    <link>https://emresahin.net/tags/xvc-file/</link>
    <description>Posts in the xvc-file tag</description>
    <language>en</language>
    <managingEditor>contact@emresahin.net (Emre Şahin)</managingEditor>
    <lastBuildDate>Tue, 15 Sep 2026 19:46:32 +0000</lastBuildDate>
    <atom:link href="https://emresahin.net/tags/xvc-file/rss.xml" rel="self" type="application/rss+xml"/>
    <item>
      <title>devlog 15</title>
      <published>2025-01-20T12:51:56+00:00</published>
      <updated>2025-01-20T12:51:56+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Mon, 20 Jan 2025 12:51:56 +0000</pubDate>
      <link>https://emresahin.net/devlog-15/</link>
      <guid isPermaLink="true">https://emresahin.net/devlog-15/</guid>
      <description>🐢 Should we go into completions directly, or do we have anything to update in the working scripts? 🐇 Starting with completions is better. One question I have is whether the completions work for subcommands as usual, like in the static completions. 🐢 Yes, they work. We need to add: source &lt;(COMPLE...</description>
      <category>xvc</category>
      <category>clap</category>
      <category>clap-complete</category>
      <category>zsh</category>
      <category>git</category>
      <category>xvc-file</category>
      <category>xvc-pipeline</category>
      <category>Rust</category>
      <category>refactoring</category>
      <category>CLI design</category>
      <category>feature flags</category>
      <content:encoded><![CDATA[<p>🐢 Should we go into completions directly, or do we have anything to update in the working scripts?</p>
<p>🐇 Starting with completions is better. One question I have is whether the completions work for subcommands as usual, like in the static completions.</p>
<p>🐢 Yes, they work. We need to add:</p>
<pre><code class="language-sh">source &lt;(COMPLETE=zsh xvc)
</code></pre>
<p>to <code>.zshrc</code>, though.</p>
<p>🐇 It looks like we can drop the <code>xvc completions</code> command. We’re just checking the <code>COMPLETE</code> environment variable, and there’s no need for a separate command in this case.</p>
<p>🐢 Yes, let’s remove that.</p>
<p>🐇 Maybe we can employ a <code>completions</code> module for all completion-related functionality. It’s a separate thing, you know.</p>
<p>🐢 Which completions do we need?</p>
<p>🐇 We can just mark them with TODOs now.</p>
<p>🐢 Yes, let’s check where we need completions and what.</p>
<p>🐇 I noticed we’re repeating options in <code>XvcFileCLI</code>, and some of the options are missing, e.g., <code>--from-ref</code> and <code>--to-branch</code>.</p>
<p>🐢 Because it can compile into a different binary, and <code>global</code> options don’t work that way. Maybe we can move all these binaries into different files under <code>lib</code>. We can have feature flags to turn off certain features and compile different binaries.</p>
<p>🦊 Let’s search for it; I haven’t seen it before: building different binaries with feature flags using <code>cargo</code>.</p>
<p>🐢 There is no clear-cut solution, but it looks like we can move all binaries to the root with the <a href="https://rustwiki.org/en/cargo/reference/cargo-targets.html#the-required-features-field"><code>required-features</code></a> field.</p>
<p>🐲 We can postpone this to another release.</p>
<p>🐇 Yes, let’s not spend time on this now.</p>
<p>🐢 Should we try making <code>pipeline_name</code> a global option? It’s repeating everywhere.</p>
<p>🐇 That will make it easier to maintain.</p>
<p>🐢 We’ll have to pass <code>pipeline_name</code> to subcommands, though.</p>
<p>🐇 I think we can have a set of global options that we can pass. For the time being, that’s only the <code>pipeline_name</code>.</p>
<p>🐢 Okay. Let’s do this.</p>
<p>🐇 A similar option is the step name for pipeline steps.</p>
<p>🐢 Dependencies will need a revamp in the next version anyway. So let’s keep it for now.</p>
<p>🐲 Also, the semantics of <code>step-name</code> are different for these commands. <code>step new</code> interprets it as a new name, while <code>step dependency</code> interprets it as an existing name. The first can be renamed to <code>--name</code>, and the second can be <code>--to</code>, as one of its aliases suggests.</p>
<p>🐢 Yes, let’s keep it for now, and we’ll continue to work on others.</p>
<p>🦊 I want to post a comment in the <code>clap</code> discussions.</p>
<p>🐢 Wrote it. Now let’s build it after changing the <code>pipeline_name</code>.</p>
<p>🐇 It compiles. Should we test it?</p>
<p>🐢 I think we’ll test after all this completion work is done.</p>
<p>🐇 We did most of the <code>strum</code>-related completion.</p>
<p>🐢 Didn’t test them yet, though.</p>
<p>🐇 This is Rust. It will work if it compiles, and it compiles.</p>]]></content:encoded>
    </item>
    <item>
      <title>devlog 2</title>
      <published>2024-05-26T17:29:09+00:00</published>
      <updated>2024-05-26T17:29:09+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Sun, 26 May 2024 17:29:09 +0000</pubDate>
      <link>https://emresahin.net/devlog-2/</link>
      <guid isPermaLink="true">https://emresahin.net/devlog-2/</guid>
      <description>We were debugging Python bindings for Xvc. xvc.file.track enters an infinite loop when given a non-existent path. To make debugging easier, we can add file deletions in the ./start-readme script to the notebook itself. Instead, I’ll run my watcher run-after-commit.sh to ensure that the files are ...</description>
      <category>devlog</category>
      <category>xvc</category>
      <category>xvc</category>
      <category>jupyter</category>
      <category>xvc-config</category>
      <category>xvc-file</category>
      <category>repr</category>
      <category>python-bindings</category>
      <category>debugging</category>
      <content:encoded><![CDATA[<p>We were debugging Python bindings for Xvc. <code>xvc.file.track</code> enters an infinite
loop when given a non-existent path.</p>
<p>To make debugging easier, we can add file deletions in the <code>./start-readme</code> script
to the notebook itself.</p>
<p>Instead, I’ll run my watcher <code>run-after-commit.sh</code> to ensure that the files
are deleted after commits.</p>
<p>That may also work; you can use both as well.</p>
<p>I noticed cli-opts pass <code>--no-system-config</code> etc. by default. Let’s deal with
this first.</p>
<p>I fixed that.</p>
<p>I’m testing whether we are in the directory that we should be in with
<code>xvc.root("--absolute")</code>, but it looks like it’s not possible to pass a string
argument to the command.</p>
<p>Let me take a look at this.</p>
<p>It looks like there have been some changes in optional parameter handling in PyO3.
You may need to deal with keyword arguments with decorators.</p>
<p>Now, let’s try <code>xvc.file().track()</code> once more with <code>dir-0001/</code>.</p>
<p>It seems to be working now. With an existing directory, it doesn’t show an
error.</p>
<p>What does <code>xvc.file().list()</code> show?</p>
<p>It shows a single string with <code>\n</code> in it. It looks like we need to handle this in
the output thread.</p>
<p>I added a <code>replace("\\n", "\n")</code> to <code>output_str</code> at the end, but it didn’t make a
difference. I tested in the notebook with <code>list_result.split("\n")</code>, and these
<code>\n</code> characters are indeed CRLF. So Jupyter shows CRLF in strings with <code>\n</code>, and
this is not something we should try to fix, I think.</p>
<p>You can search how to show <code>\n</code> characters in a Jupyter notebook with CRLF.</p>
<p>The output string should be fed into <code>repr</code>, as in:</p>
<pre><code class="language-python"># Define a string with CRLF characters
text_crlf = "Hello\r\nWorld\r\nThis is a test string."

# Use repr to show the \r\n characters explicitly
print(repr(text_crlf))
</code></pre>
<p>I tested this, and GPT misleads. <code>repr</code> is when you <em>want</em> to show <code>\n</code>, not
vice versa. When I <code>print(list_result)</code>, it prints the results properly.</p>
<p>It looks like we don’t need to make this a priority now. We can tell the user in the
notebook that the commands are intentionally returning strings, and they can
process or print them however they want.</p>]]></content:encoded>
    </item>
  </channel>
</rss>
