From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id KK0eDMsKF2HJSAEAgWs5BA (envelope-from ) for ; Sat, 14 Aug 2021 02:14:03 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id GLXGB8sKF2HTbAAAB5/wlQ (envelope-from ) for ; Sat, 14 Aug 2021 00:14:03 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5CCB72ACBD for ; Sat, 14 Aug 2021 02:14:02 +0200 (CEST) Received: from localhost ([::1]:50260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mEhJJ-0000wq-9f for larch@yhetil.org; Fri, 13 Aug 2021 20:14:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57780) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mEhIX-0000u9-IO for emacs-orgmode@gnu.org; Fri, 13 Aug 2021 20:13:13 -0400 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]:33495) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mEhIV-0006e2-Sl for emacs-orgmode@gnu.org; Fri, 13 Aug 2021 20:13:13 -0400 Received: by mail-pl1-x633.google.com with SMTP id a20so14149524plm.0 for ; Fri, 13 Aug 2021 17:13:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version; bh=a11dSoaQVN/ifrRsDBHMnEus/2/4mgVdLWi/CzSxWUc=; b=dTgUoGarij62DOQ5/7Cepb+d0VYS09kY6GMlKqp3X7Z3L2phsL5rMYeU3bPWuWsNy3 Qx8wzMfknaRfKO+BTFpxosLODnIdHeY1/WSV8BzVNahW5A+vNW6byHHY1pg2yVLxcKXz eRxaZT8BUzb3zhDL733K4GFXVCg029d+Fh/62Q66pVqbDK17knpOA8U79hJmEB7ZKiKi 2p2J5RwQmjGJB0w4UpVuH/57kcD6DVmbLX+E5n+iVjkfTU9g5DRU7P8NDW2qzl/Y4wBX hExpyCgzeeGhpxDqIKSxC2VpTtyXFw1WTlVXtkOwkAgAkrZexPPA36W3qFtdnW57gkF9 3mpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version; bh=a11dSoaQVN/ifrRsDBHMnEus/2/4mgVdLWi/CzSxWUc=; b=Sd4TfP5DJkkJSMg+lfPxnmUQ2QPs2I+LEDLCYqyKz4FMxXaZisEpIBCXFMeX+VxlBM Y9U3Z5udbeuaeo6VIsyaCwM9lUdfNGkYyGM5vhaL+nxNyNOC1gjJI0v1ITMLLBslB5Zf y5xIATI2ObsP6dqodnUtaj8yLziN47MwGZbvvnFbtMu6c9mwF7xd/vVsC3QDvHgVC8tQ 0DVCM9EDZAEmTEbu1og3CF2beyZ5FhF0BW6LJj2z9c4OVaZaIG03I8+5YiYoXXE7d2fW ea+zlpnlrHJFdbnvdq7D3Qj281AsIyzCF5VNeLd43Y2KNKwd23byxzBgJZEjlGNPNPKh 6FDw== X-Gm-Message-State: AOAM530dlZi1ozMq1rrcYzkq5hWp7PijsrTp++u7nKXnx64EMwJpKZnM E/n2NNHqyiBkeljqXd5tlZVtG+nwPSo= X-Google-Smtp-Source: ABdhPJyo7bq2VgPUOHdK161yDGU7lSg4fFK9Vywr/EFLuleq6XkQwfUIjVplAnLUVDLKKGcB2JH9Fg== X-Received: by 2002:a62:7b50:0:b029:3cd:e227:3486 with SMTP id w77-20020a627b500000b02903cde2273486mr4809449pfc.74.1628899990281; Fri, 13 Aug 2021 17:13:10 -0700 (PDT) Received: from tim-desktop (220-235-12-146.dyn.iinet.net.au. [220.235.12.146]) by smtp.gmail.com with ESMTPSA id y4sm2863614pjg.9.2021.08.13.17.13.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Aug 2021 17:13:09 -0700 (PDT) References: <87czqh5gt1.fsf@gmail.com> User-agent: mu4e 1.6.3; emacs 28.0.50 From: Tim Cross To: emacs-orgmode@gnu.org Subject: Re: Org + git branches for derived files Date: Sat, 14 Aug 2021 09:10:26 +1000 In-reply-to: <87czqh5gt1.fsf@gmail.com> Message-ID: <87r1ew28a6.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=theophilusx@gmail.com; helo=mail-pl1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1628900042; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=a11dSoaQVN/ifrRsDBHMnEus/2/4mgVdLWi/CzSxWUc=; b=cRQmGLqB8ZpohAE/n8q2foj6xpRcWVHxMdGZe5cafgmpLaD+wyYpHIAmgf2faNZ2BLhbZG 5GzmDTfUE4UOygcodEOuv7zqtfPpMZF2I5YKP02bqdvI79A9UD+z2g6AUNvb4MUDNE7hVq CL4Q7GGI8wEXLr7TR4uSSLl7rA7IozI+QebQQFWmNK8iaP7E8DMSNQpDMkab0oksqMhIwe W62M1J6wGEr2oUjvQ3t8r2b7HGMBEL+qVrpFCIC7Y5HkBz6AtOfIjk2ixpnmqBRWzbQE8y TjgcxgZwWV054qQj1ivN0Y0R87ZeeVt4zhrmZRPLHwuIi1S03jMH+UIwAXpthQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628900042; a=rsa-sha256; cv=none; b=o7qpIoOcBKYMxG6sTKQJ9NscCFETjpUTo4IhXBtiIJSlUC+0S3g22XozlG4r80J4GO6OEu sJQcb395FVkPl3zq+JxNSfET0H1HXAYq9hxavBaGe5pHXA98TbzR0N0X/q1+SgEnLv/kUe CuEUWIm46rIT7Fae7+mxfQn5ncyRF+VcaiRCDWBmmDYvXT2yiPMhJoAMfNEivUZIf0EONC YZig1ffgyzdS5anlk2KxXtyKksq+N5BBcqGuisw+StnD9OOzOUSIPx8XoVIFBogZP5aPZQ W6pgEvSH2K6dXutnz4FBl5e7KqnQKl1Q1bT2nSrWEInHZpMDZcg1SrTOXciUUQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=dTgUoGar; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.11 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=dTgUoGar; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 5CCB72ACBD X-Spam-Score: -3.11 X-Migadu-Scanner: scn0.migadu.com X-TUID: Lya09kjihzg4 Ken Mankoff writes: > Hello, > > I think this might be more of a git question than an Org question, but I imagine > I might find the answer here and that it might be useful to others, so I ask > here. > > I'd like to keep derivative products (the LaTeX output, the final PDF, etc.) > available in Git, but not commit those changes each time I change the Org file. > Perhaps git-annex as appropriate for this, but seems over-kill. > > Is there some way to mostly-seamlessly commit the LaTeX and/or PDF and/or other > files to their own git branches but in a way that overwrites the history of that > branch, so that a small Org file that generates a big binary PDF does not > pollute the git tree? > > Thanks, > > -k. I think your definitely in salmon mode here :-) and swimming against the flow. Typically, you would not add derived artefacts to git at all. You have a full history of your original org file versions and therefore can extract any version and use it to re-generate any version of a derived artefact, so you would typically just ignore them and just re-generate as needed. Of course the 'easy' solution is simply not to do 'git add' on the artefact until you want it committed. Provided you don't use 'git commit -a' and only use 'git add' then the modified file will not be added to git. When your ready to add the updates to git, then do 'git add' and then commit. If you really want this, I can think of 2 possible solutions. The first would be to use git submodules - basically, turn a directory in your main git repository into a separate git repository that is a child of your main git repository. When you have generated a new artefact and want to keep it in git, copy it to the sub-module repository and commit it there. In your main repository, you would add the files to .gitignore. Now, unless you copy a new version into the sub-module directory, it won't be added. It also won't show up in diffs/patches generated from your main parent repository. The second solution would be to use the command git update-index --assume-unchanged FILE_NAME to prevent git from committing that file and when your ready to commit it, do git update-index --no-assume-unchanged FILE_NAME which will make the file show up in git status etc again. There is no way I know of to stop git from tracking/recording the changes - this is how it works and of course, it doesn't work well with binary or semi-binary files. You will get large diffs when dealing with PDFs etc. Personally, if I had to do something like this, I would go with the sub-module approach rather than 'update-index'. This would at least keep the 'mess' in a separate git repo so that you can do diffs and patches on your main repo without lots of 'noise' and it would be less prone to forgetting to change the file index settings etc. In the past, when I have had a repository where I wanted a PDF to be available to users of the repository, rather than adding that PDF to the repository, I added a command (script, makefile entry etc) that would generate the derived artefact on demand rather than having it in the repository.