有没有办法在我的Git存储库中添加Subversion存储库作为Git子模块?
就像是:
git-svn submodule add https://svn.foo.com/svn/proj --stdlayout svn-project
Run Code Online (Sandbox Code Playgroud)
凡https://svn.foo.com/svn/proj指向Subversion库.
我知道有git-svn一个允许人们与Subversion存储库进行交互.所以我想,也许有办法检查Subversion存储库,git-svn然后将其用作子模块.
我想重用一些在BSD许可下许可的代码,但我不知道如何清楚我写的内容,我重用的内容以及我修改过的内容.
假设我想重用代码的项目具有以下目录结构:
project/
|-- LICENSE.txt
|-- module1/
| |-- file1.c
| |-- file2.c
| `-- file3.c
|-- module2/
`-- module3/
Run Code Online (Sandbox Code Playgroud)
LICENSE.txt的内容是BSD许可证,即其内容为:
Copyright (c) <year>, <copyright holder>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
[...]
Run Code Online (Sandbox Code Playgroud)
(有关全文模板,请参阅维基百科.)
此外,版权仅在LICENSE.txt文件中声明,而不是在每个单独的源代码文件中声明.
如果我现在将project/module1 /下的所有内容复制到我自己的项目中:
my_project/
|-- module1/
| |-- file1.c
| |-- file2.c
| `-- file3.c
|-- my_file1.c
|-- my_file2.c
|-- my_source_code1/
`-- my_source_code2/
Run Code Online (Sandbox Code Playgroud)
我应该如何声明我不是module1下文件的版权所有者?是否足以将原始LICENSE.txt与原始版权所有者一起复制到module1子目录中?或者我应该为每个单独的文件添加版权标题?
如果我修改module1下的任何文件怎么办?我是否应该以某种方式将自己添加为我修改的文件的附加版权所有者?
注意:对于我编写的代码使用相同(或兼容)的许可证,我完全没问题.
我试图在后台启动一个远程机器上的工作并获得它的PID,以便我可以在以后杀死它.到目前为止我想出的是以下内容:
#!/bin/bash
IP=xxx.xxx.xxx.xx
REMOTE_EXEC="ssh $IP -l root"
# The following does NOT work, I am trying to get the PID of the remote job
PID=`$REMOTE_EXEC 'vmstat 1 1000 > vmstat.log & ; echo $!'`
# Launch apache benchmark
ab -n 10 http://$IP/
$REMOTE_EXEC "kill $PID"
Run Code Online (Sandbox Code Playgroud)
不幸的是它不起作用.我得到了一个
bash: syntax error near unexpected token `;'
Run Code Online (Sandbox Code Playgroud)
但我不知道正确的语法是什么.
我有两个中断服务程序(ISR),基本上完全相同,但每个处理来自不同设备的中断(虽然是相同类型的设备).因此,逻辑是相同的,但它们访问不同的CPU寄存器和存储器位置.
作为一个简单的示例,请考虑以下代码:
extern volatile unsigned int dev1_rx_buffer;
extern volatile unsigned int dev2_rx_buffer;
volatile unsigned char data;
void __attribute__((__interrupt__)) _dev1_interrupt(void)
{
/* Clear interrupt flag */
dev1.IF = 0;
if (dev1.IS_FULL) {
/* Read data from device */
data = dev1_rx_buffer;
} else {
/* do something else using registers of device 1 */
}
/* More stuff using registers of device 1 */
}
void __attribute__((__interrupt__)) _dev2_interrupt(void)
{
/* Clear interrupt flag */
dev2.IF = 0;
if (dev2.IS_FULL) {
/* …Run Code Online (Sandbox Code Playgroud) bash ×1
c ×1
embedded ×1
git ×1
git-svn ×1
licensing ×1
open-source ×1
refactoring ×1
ssh ×1
svn ×1